Class: Encrypted::AES

Inherits:
Rijndael show all
Defined in:
lib/encrypted/rijndael.rb

Overview

This is exactly the same as Encrypted::Rijndael except that the only allowed block size is 128-bit (16 bytes ), which affects possible IV (for CBC and other block-chaining algorithms) and plaintext block lengths.

Given the effort that went into standardising on AES, you may well want to use this instead of Encrypted::Rijndael for encryption if you’re interoperating with another party. Of course, you can safely use Encrypted::Rijndael for decryption in that circumstance.

The spec for this is in an US government standards document named FIPS-197. Google for it.

Constant Summary collapse

AES_BLOCKSIZE_BYTES =
16

Class Method Summary collapse

Methods inherited from Rijndael

#block_sizes_supported, #blocksize, #blocksize=, #decrypt, #encrypt, #initialize, key_sizes_supported

Constructor Details

This class inherits a constructor from Encrypted::Rijndael

Class Method Details

.block_sizes_supportedObject

Only one block size is supported for real AES: 16 bytes.



159
160
161
# File 'lib/encrypted/rijndael.rb', line 159

def self.block_sizes_supported
  [AES_BLOCKSIZE_BYTES]
end