使用以下这个简单封装的加密类~~~当然,需要先下载附件:crypto.rar
直接解压放到工程目录,就可以调用啦~~简单方便,做表单加密不错~~
package crypto
{
import com.hurlant.crypto.Crypto;
import com.hurlant.crypto.symmetric.AESKey;
import com.hurlant.util.Hex;
import flash.utils.ByteArray;
public class KCrypto
{
private static const SECRET_KEY:String = "suibian";
public function KCrypto()
{
}
public static function encryptByAES(plainText:String):String
{
return AES.encrypt(plainText, SECRET_KEY, AES.BIT_KEY_128);
}
public static function decryptByAES(encryptedText:String):String
{
return AES.decrypt(encryptedText, SECRET_KEY, AES.BIT_KEY_128);
}
}
}