Patent ID: 7162645

Claim:
A storage device, comprising: a controller and a second non-volatile memory, said controller including a first non-volatile memory, wherein said controller further includes a first interface for connecting said controller to a host terminal device, a second interface for connecting said controller to said second non-volatile memory, a central processing device, and a volatile memory utilized by said central processing device, said first non-volatile memory includes a first storage area for storing Km data used for encrypting or decrypting a program to be executed by said central processing device and a second storage area for storing data from said host terminal device, said second non-volatile memory includes an access-permitted area for storing data from said host terminal device and an access-prohibited area for storing said program encrypted using said Km data, an access by a user being permitted to said access-permitted area but being limited to said access-prohibited area, and said controller: stores the data from said host terminal device in said access-permitted area of said second non-volatile memory without encryption, if a security level of the data from said host terminal device is lower than a predetermined level; checks a free available capacity of said first non-volatile memory, if the security level of the data from said host terminal device is higher than the predetermined level; stores the data from said host terminal device in said second storage area of said first non-volatile memory, if the free available capacity of said first non-volatile memory is sufficient; and stores the data from said host terminal device in said access-permitted area of said second non-volatile memory after encrypting the data from said host terminal device by using said Km data, if the free available capacity of said first non-volatile memory is insufficient.