2011-04-04 33 views
0

我想Base 64使用opessl enc加密密码,但是当密码包含单引号时,它不会返回任何内容。openssl enc有单引号问题(')

你知道我可以用来避免这种情况吗?

非常感谢

+0

样本只会是公平的,没有? – sehe 2011-04-04 21:41:03

回答

1

大概shell引用被绊倒您

[email protected]:~$ base64 <<< "this isn't a problem" 
dGhpcyBpc24ndCBhIHByb2JsZW0K 
[email protected]:~$ base64 <<< 'this isn't working' 

还使用OpenSSL:

[email protected]:~$ echo -n "I don't see the \" problem \"" | openssl enc -e -a 
SSBkb24ndCBzZWUgdGhlICIgcHJvYmxlbSAi