Patent ID: 8139766

Claim:
A method for performing key encryption with the use of an apparatus including an encryption-authentication section, comprising: issuing a first ID in response to a request by a user, and storing the first ID in a storage section; generating a key corresponding to the first ID and outputting the key; in response to a request by a user for decryption or generation of a message authentication code, comparing an inputted second ID and the first ID; handing over the first ID to the key generation section to output a key generated by the key generation section if the first ID and the second ID correspond to each other, and outputting an error message if the first ID and the second ID do not correspond to each other; in response to a request by a user for encryption or verification of a message with a message authentication code attached thereto, handing over the inputted second ID to the key generation section to output the key generated by the key generation section; handing over the inputted second ID to the first key acquisition section; with the use of a key outputted from the first key acquisition section, calculating and outputting a message authentication code of an inputted message; handing over the inputted second ID to the second key acquisition section, calculating the message authentication code of the inputted message with the use of a key outputted from the second key acquisition section, and comparing an obtained message authentication code and an inputted message authentication code; outputting a success message if the obtained message authentication code is the same as the inputted message authentication code; outputting a failure message if the obtained message authentication code is not the same as the inputted message authentication code; handing over the inputted second ID to the second key acquisition section, encrypting inputted text with the use of the key outputted from the second key acquisition section, and returning the result to the user; and handing over the inputted second ID to the first acquisition section and, with the use of the key outputted from the first key acquisition section, decrypting and outputting inputted encrypted text.