The encryption/decryption device includes: a data structure analysis block
for receiving encrypted data or data to be encrypted and outputting
control data and also the encrypted data or the data to be encrypted as
processing block input data; a data control block for determining a mode
selection signal according to the control data; and a shared processing
block for performing encryption or decryption for the processing block
input data and outputting the result. The shared processing block is
configured to have the ability to perform encryption and decryption in
either of the CBC mode and the CFB mode by performing ECB processing
using input key data, and performs encryption or decryption in the mode
indicated by the mode selection signal.