zamiere / slowaes

Automatically exported from code.google.com/p/slowaes
0 stars 0 forks source link

IV problem #17

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create an encrypted data with static KEY and IV
2. Once you try to decrypt the data with the same KEY and different IV the 
message is displayed and only the first line is scrambled

What is the expected output? What do you see instead?
I was expecting that once the IV is changed the whole message will be scrambled 
but instead it is only the first line

What version of the product are you using? On what operating system?
The last version available for download.

Original issue reported on code.google.com by tomchev....@gmail.com on 5 Dec 2012 at 9:02

GoogleCodeExporter commented 9 years ago
Actually it is only the first 16bits that are scrambled and not the first line

Original comment by tomchev....@gmail.com on 5 Dec 2012 at 9:13

GoogleCodeExporter commented 9 years ago
This are the first couple of lines of my decrypted python file:
*COu|/dŏy#rython
# -*- coding: utf8 -*-
#-------------------------------------------------------------------------------
# Name:   

and the lines before encryption are:
#!/usr/bin/env python
# -*- coding: utf8 -*-
#-------------------------------------------------------------------------------
# Name:   

Original comment by tomchev....@gmail.com on 5 Dec 2012 at 9:17

GoogleCodeExporter commented 9 years ago
Unless I'm misunderstanding, this is correct behavior.

In CBC mode, decryption works by decrypting the block using the key, and then 
XORing it with the previous encrypted block. The IV is simply a stand-in for 
the "previous encrypted block" of the first block. So, mucking with the IV of 
already-encrypted data will only screw up decryption of that first block.

It's only in the encryption phase that a different IV should cause a cascading 
change to future blocks.

Original comment by dhamm...@webdevout.net on 2 Oct 2013 at 1:47