sgzwiz / as3crypto

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

AES mode Error #30

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. select secretKey, AES, ECB, NONE...
2. any keyFormat....
3. inputText "aaaaa"
4. press "Encrypt"button... is Error..

so...I was..Fix Source...(I`m not English well...Sorry...)

File:com.hurlant.crypto.symmetric.ECBMode

//Line:43 insert...
//=========fix
while(blockSize>src.length)
{
    src.position = src.length;
    src.writeByte(0);
}
src.position = 0;
//===========

byebye~~

                                               -    andwhy@naver.com

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by andwhy...@gmail.com on 8 Dec 2009 at 8:50

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
//===line:45

for (var i:uint=0;i<src.length;i+=blockSize) {
tmp.length=0;
var temPosition:uint = src.position;
while(blockSize+temPosition>src.length)
{
    src.position = src.length;
    src.writeByte(0);
}
src.position = temPosition;
src.readBytes(tmp, 0, blockSize);
key.encrypt(tmp);
dst.writeBytes(tmp);
}

Original comment by andwhy...@gmail.com on 8 Dec 2009 at 9:19