2012-02-28 56 views
0

与没有probs http://www.zedia.net/2009/as3crypto-and-php-what-a-fun-ride/使用as3Crypto加密/解密与仅网址查询保存我用as3Crypto字符

但它产生一个字符串,其中包括相等(也可能是其它网址查询不安全的字符)。有没有像这样加密的方法?

下面

当前代码:

public function encrypt(txt:String = ''):String 
{ 
    var data:ByteArray = Hex.toArray(Hex.fromString(txt));  
    var pad:IPad = new PKCS5; 
    var mode:ICipher = Crypto.getCipher(type, key, pad); 
    pad.setBlockSize(mode.getBlockSize()); 
    mode.encrypt(data); 
    return ''+Base64.encodeByteArray(data); 
} 

回答

1

是,基地64编码是正常的方式做到这一点,但你仍然必须URL逃脱的结果,因为Base64编码包含不安全字符,以及(“/”,' +'和'='是精确的)。

+1

...什么从我的答案缺失,阿什利? – 2012-03-08 20:30:41