I am trying to set up a KeyChain password using the security in my macOS terminal, and it happens that the special characters are encoded and not set to the keychain as it is rather encoded..
When I run this
security add-generic-password -a comp -s example -w 'ã!¼àÁu' -T ""
There will be no error but when the password is called back it is encoded with the something like below
c3a321c2bcc3a0c38175
Does anybody know how i can achieve using this kind of characters without security encoding it as it currently does?
That looks right to me. THe first character in your example is ã
, or U+00E3 LATIN SMALL LETTER A WITH TILDE. Its UTF-8 encoding is C3 A3, which is the prefix of the result you’re seeing.
What are you actually trying to do here? Keep in mind that a generic password items doesn’t store a string but rather data. If you supply a string on the command line, the security
tool has to do some sort of text encoding conversion, to get a data value from the string. It’s chosen to do UTF-8 conversion, which is a good choice IMO.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"