I am looking for an easy way to “encrypt” data that my app will be storing in a user’s plist file. I don’t need anything that requires serious, top-security encoding, but the final release app will have some passwords and login info that prying eyes shouldn’t be able to just come upon and write down. In perl I simply translate the string to ascii values, which turns it into a jumble of seemingly random characters, rather than an obvious and legible string. Obviously, any 2-bit teenage snoop could get the meat and potatoes out of this, but I’m not guarding national secrets so I’m not THAT worried. I just want a way to turn “MyUsername” and “MyPassword” into something functionally unreadable.
Does anyone know of a low-overhead way to do this, without writing a complicated encrypting formula? I’d be happy just shifting characters or translating to another encoding type, but cannot find a way that can be performed both ways… to both pack and unpack the data.
Or, as Rainy Day said, you can use a very simple shell script. Eg, use base64, which is a very simple algorithm:
set semiEncryptedPW to (do shell script "echo " & quoted form of ¬
(text returned of (display dialog "Please, enter pw!" default answer "" with icon note)) & ¬
" | openssl base64")
set decryptPW to (do shell script "echo " & quoted form of ¬
(text returned of (display dialog "Please, enter pw!" default answer semiEncryptedPW with icon note)) & ¬
" | openssl base64 -d")
Or the md5 checksum (you simply store the checksum, then check the pw against the checksum):
set pwMD5 to (do shell script "echo " & quoted form of ¬
(text returned of (display dialog "Please, enter pw!" default answer "" with icon note)) & ¬
" | openssl md5")