A block cipher is a deterministic algorithm that operates on fixed-length groups of data, called blocks. Like stream ciphers, block ciphers are a kind of symmetric encryption.
Block ciphers are widely used in real-world applications to encrypt large amounts of data.
The Go standard library has built-in support for the AES and DES block ciphers, which we will talk about in more detail later.
We've been asked by leadership to check on the block sizes of each algorithm and report back. Complete the getBlockSize function.
This function accepts a keyLen and cipherType and returns the block size of the cipher along with any errors encountered.
The cipherType is an enum of typeAES or typeDES. Depending on the cipher type, create a new cipher using:
The value of the key passed in doesn't matter here, all that matters is its length.
invalid cipher type error if the cipherType isn't one of the valid values.