Memory storage device and method
The present disclosure relates to secure storage, in a non-volatile memory, of initial data encrypted using a second data, including selecting a pointer aimed at an initial address of a memory cell of an initial part of the non-volatile memory, and encrypting the pointer using the second data; and—storing the encrypted pointer in the non-volatile memory.
1 . A method for securely storing information, the method comprising:
encrypting initial data using a second data;
setting an index variable to a first value;
selecting an indexed pointer aiming towards an indexed address in an initial part of a non-volatile memory, and associating the indexed pointer and the indexed address with the first value of the index variable;
storing the encrypted initial data at the indexed address of the non-volatile memory;
incrementing the index variable; and
performing a sequence:
encrypting the indexed pointer associated with a current value of the index variable decremented by one using the second data;
selecting a new pointer aiming towards a new address of the initial part of the non-volatile memory, and associating the new pointer and the new address with the current value of the index variable;
storing the encrypted indexed pointer associated with the current value of the index variable decremented by one at the new address in the initial part of the non-volatile memory;
determining that the current value of the index variable is less than a final value minus one; and
in response to determining that the current value is less than the final value minus one, incrementing the index variable and repeating the sequence using the new pointer as the indexed pointer.
2 . The method according to claim 1 , further comprising randomly selecting the pointers.
3 . The method according to claim 1 , further comprising selecting the pointers from a predefined group of pointers aiming at addresses of the initial part of the non-volatile memory.
4 . The method according to claim 1 , wherein the initial part is a non-rewritable part of the non-volatile memory.
5 . The method according to claim 1 , wherein:
the first value of the index variable is zero; and
the final value of the index variable is greater than or equal to two, and is less than a total number of addresses in the initial part of the non-volatile memory.
6 . A method for reading information securely stored in a non-volatile memory, the method comprising:
receiving a second data;
setting an index variable to a final value minus one;
performing a sequence:
reading an encrypted indexed pointer associated with a current value of the index variable and stored in the non-volatile memory;
decrypting the encrypted indexed pointer associated with the current value of the index variable using the second data;
verifying that the decrypted indexed pointer points to an indexed address associated with the current value of the index variable in an initial part of the non-volatile memory;
determining that the current value of the index variable minus one is not equal to a first value; and
in response to determining that the current value of the index variable minus one is not equal to the first value, decrementing the index variable and repeating the sequence;
reading, using the decrypted indexed pointer associated with the first value of the index variable plus one, encrypted secret data stored at the indexed address associated with the first value of the index variable plus one in the initial part of the non-volatile memory; and
decrypting the encrypted secret data using the second data.
7 . The method according to claim 6 , wherein the pointers are randomly-selected pointers.
8 . The method according to claim 6 , wherein the pointers are from a predefined group of pointers aiming at addresses of the initial part of the non-volatile memory.
9 . The method according to claim 6 , wherein the initial part is a non-rewritable part of the non-volatile memory.
10 . The method according to claim 6 , wherein:
the final value of the index variable is greater than or equal to two, and less than a total number of addresses in the initial part of the non-volatile memory; and
the first value of the index variable is zero.
11 . An electronic system configured to securely store information, the electronic system comprising:
a non-transitory memory comprising instructions; and
a processor in communication with the non-transitory memory, wherein the processor executes the instructions to:
encrypt initial data using a second data;
set an index variable to a first value;
select an indexed pointer aiming towards an indexed address in an initial part of a non-volatile memory, and associate the indexed pointer and the indexed address with the first value of the index variable;
store the encrypted initial data at the indexed address of the non-volatile memory;
increment the index variable; and
perform a sequence:
encrypt the indexed pointer associated with a current value of the index variable decremented by one using the second data;
select a new pointer aiming towards a new address of the initial part of the non-volatile memory, and associate the new pointer and the new address with the current value of the index variable;
store the encrypted indexed pointer associated with the current value of the index variable decremented by one at the new address in the initial part of the non-volatile memory;
determine whether the current value of the index variable is equal to a final value; and
in response to determining that the current value is less than the final value, increment the index variable and repeat the sequence using the new pointer as the indexed pointer.
12 . The electronic system according to claim 11 , wherein the processor executes the instructions to randomly select the pointers.
13 . The electronic system according to claim 11 , wherein the processor executes the instructions to select the pointers from a predefined group of pointers aiming at addresses of the initial part of the non-volatile memory.
14 . The electronic system according to claim 11 , wherein the initial part is a non-rewritable part of the non-volatile memory.
15 . The electronic system according to claim 11 , wherein:
the first value of the index variable is zero; and
the final value of the index variable is greater than or equal to two, and is less than a total number of addresses in the initial part of the non-volatile memory.
16 . An electronic system configured to securely read information, the electronic system comprising:
a non-transitory memory comprising instructions; and
a processor in communication with the non-transitory memory, wherein the processor executes the instructions to:
receive a second data;
set an index variable to a final value minus one;
perform a sequence:
read an encrypted indexed pointer associated with a current value of the index variable and stored in a non-volatile memory;
decrypt the encrypted indexed pointer associated with the current value of the index variable using the second data;
verify that the decrypted indexed pointer points to an indexed address associated with the current value of the index variable in an initial part of the non-volatile memory;
determine whether the current value of the index variable minus one equals a first value; and
in response to determining that the current value of the index variable minus one is not equal to the first value, decrement the index variable and repeat the sequence;
read, using the decrypted indexed pointer associated with the first value of the index variable plus one, encrypted secret data stored at the indexed address associated with the first value of the index variable plus one in the initial part of the non-volatile memory; and
decrypt the encrypted secret data using the second data.
17 . The electronic system according to claim 16 , wherein the pointers are randomly-selected pointers.
18 . The electronic system according to claim 16 , wherein the pointers are from a predefined group of pointers aiming at addresses of the initial part of the non-volatile memory.
19 . The electronic system according to claim 16 , wherein the initial part is a non-rewritable part of the non-volatile memory.
20 . The electronic system according to claim 16 , wherein:
the final value of the index variable is greater than or equal to two, and less than a total number of addresses in the initial part of the non-volatile memory; and
the first value of the index variable is zero.