Handling AES encryption using CTR mode (storing vi)

Viewed 37

I was trying to come up with AES encryption scheme for my project. Basically I want the user to crypt data using just a 32 byte key to decrypt a file of crypted data, since remembering and storing vi for every block seems very cumbersome. I know of many encryption programs that use just a key for encryption and nothing else. How do i go about this problem?

My current scheme looks something like this:

Block:
16 bytes vi, up to 1 048 576 bytes of data (1MB)

Encryption:

  1. Input 32 byte key
  2. First vi is randomly generated 16 bytes that get encrypted with AES ECB (initial key)
  3. 1MB of data is encrypted using CTR (initial key, the block vi)
  4. Any further block follows the same logic

Decryption:

  1. Input 32 byte key
  2. Decrypt first 16 bytes using ECB
  3. Decrypt the first block of data using CTR (initial key, the block vi)
  4. Any further block follows the same logic

Is this good enough security wise? I think it should work since vi for every block is random, and since vi itself is encrypted using ECB it works pretty much like one time pad, correct?

0 Answers
Related