actionscript 3 - Is there any best way to implement Encryption in Flex 3 -
we have 1 application pulling confidential information 1 of product design tools. have used https channel , encrypting request parameters , data before sent web services. so, seems ok.
but when gave application security auditing found have hard coded encryption key in source code. have used sothink swf decompiler swf file. caught key , raised concern on it.
we have developed application using flex 3(sdk 3.4). there best way use secret key without being hard coded in source code. if come across kind of problem, please let me know.
anyone, please suggest me best way use secret keys in sourcecode without being hard coded.
here sample code:
var currentresult:string = ""; var strdatatoencrypt:string = ""; var kdata:bytearray; var todaydate:date = new date(); kdata = hex.toarray(hex.fromstring("secretkey here")); strdatatoencrypt =username.touppercase() + "#$#" + password + "#$#" + todaydate.gettime().tostring(); var data:bytearray; data = hex.toarray(hex.fromstring(strdatatoencrypt)) var name:string = "des3-ecb"; var pad:ipad = new pkcs5; var mode:icipher = crypto.getcipher(name, kdata, pad); pad.setblocksize(mode.getblocksize()); mode.encrypt(data); currentresult = base64.encodebytearray(data); var token:string = currentresult;
there no such thing complete protection flash. keys have either in code or loaded externally, , @ point determined enough able them. can make process complex it's not worth hassle.
have @ question ways make source harder decompile , read: how protect swf file being decompiled?
Comments
Post a Comment