i want to encrypt and decrpyt files with adobe air. and i am successfully encrypt files with code. but i dont yet decrpyt an encrypted file please help me, what can i do?
i am using this code for encrypt:
import com.hurlant.crypto.symmetric.AESKey;
import com.hurlant.crypto.symmetric.DESKey;
import com.hurlant.util.Hex;
import flash.filesystem.FileStream;
import flash.filesystem.File;
import flash.utils.ByteArray;
import flash.filesystem.FileMode;
import flash.display.BitmapData;
import flash.display.Bitmap;
import com.hurlant.util.ArrayUtil;
stop();
var stream:FileStream;
var stream2:FileStream;
var file:File;
var fileToEncrypt:ByteArray;
encrypt();
function encrypt():void
{
file = File.applicationDirectory.resolvePath("logo_markatalog.png");
fileToEncrypt = new ByteArray;
stream = new FileStream();
stream.open( file, FileMode.READ );
stream.readBytes(fileToEncrypt);
stream.close();
var appDir:String = File.applicationDirectory.nativePath;
//file = File(appDir+"logo_markatalog_enc.png");
file = new File(appDir+"/logo_markatalog_enc.png");
var key:ByteArray = Hex.toArray("635232557");
var aes:AESKey = new AESKey(key);
aes.encrypt(fileToEncrypt);
stream2 = new FileStream();
stream2.open( file, FileMode.WRITE );
stream2.writeBytes(fileToEncrypt);
stream2.close();
}