OK, now I have coded for an implementation of AES-128 🙂
It is working fine.
It takes in 128 bits, encrypts and returns 128 bits
So how do i enhance my function so that it can handle more than 128 bits?
How do i make the encryption algorithm handle larger strings?
Can the same algorithm be used to encrypt files? 🙂
The function definition is
public byte[] Cipher(byte[] input)
{
}
There are various “chained” or “codebook” modes that you can run a block cipher in. You’ll need to read about them and decide which you’re going to support. You’ll also need to decide what sort of block padding you’ll do for partially filled terminal blocks.
Have a read of http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation to start with.
Yes, of course you can encrypt files. You just write the blocks out to another file.
Get a copy of Applied Cryptography if you’ve not already got one. It’s the best intro into this sort of thing that I’ve read even though it’s quite long in the tooth now.