2011-04-04 64 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