U2FsdGVkX1/NLlJb285fLcFFmqC//raFSTimg0n2xYxXrhWzxhYe4Xs531onMQ7U
l1HXvOVzgIyB1OOT1szrZo/Dx8YAfuRdmj2MeAqbfHTYl7/w5JyGsL+rEqJ4qZ+M
FkmqRSEx3K0cqEv6ZgpCwglXQ5W7yWhjm7+xUb5oM6YCzExsE30Swk6tNKM+K34f
SscDpy0aZzdKqci0z1brwpUWXk6ZefaShwlQ5goCSzO0ZtLy/U+GII6Cto+iT0+c
2kFR5roYDPZo6w0ujAIAjNxmYjEP7jvHuYqS1OcvmtPXBdGzRFLuyS25bgxVLC8Y
1q4hFagYrksnLgCLvVTlv+DRIbEsgizVCwdZJa1u5jqBbVGQwoNXiDPvZ6Hj1UL5
p4ddM0ZmxaGap2/Xb/SKhrF/O6ia7jiZlexEQc4NldT6fdZmplKWyeanoOoCe9OG
88mPf6Te2I+n1amKPcQGbldA0tmbziUs3by7FmJPCB8GXH8bAHt6DKhEvgQ505iH
ZIAg1fs8Gj9p1MjfVXqkTbKbd4ZQJGiepf19h3o5+jMvHP3EMwYe0zOv6qncIv6/
BoGKifPFyWVgYHq3ylV2fYGru7rSDo2K9JgGeg3dgZsW0Ku3LKjtaseqi8fCIG7i
Effe2ldRrYnPo3uvE9X0V3AViJ4bWzNYQrNHeG0YMLv+WPAk4xT+eg==
http://snipr.com/1w33q-suqau3
Link is obsolete. ^^^^^
processInput("", "Encrypt")
(* * * * * * Handlers for encrypting the data * * * * * * * * * * *)
to eS(inS, inK, inM)
(* 'Encrypt String':
This handler uses the blowfish encryption available in openssl.
The handler is configured to accept the string to be encrypted, the key to use
(generated by the 'gK()' handler below), and the mode to pass to the openssl
call... either encrypt("e") or decrypt("d"). *)
return do shell script ("echo " & (quoted form of inS) & " | openssl enc -bf -" & inM & " -pass pass:" & (quoted form of inK) & " -salt -a")
end eS
to gK()
(* 'Get Key':
This handler assembles a password(encryption key) to use with the blowfish script
This is done to better hide the key in the script, so people reading through a
compiled, run-only script will have a difficult time determining what the key is. *)
set kL to {"jTiiGHa67567U2FsdGVkX184g", "C3w2235689mNVxw35467JnJMH", "JGdD34hn7n7N6bdFg67H6d54o"}
return ((characters 8 through 13 of (item 2 of kL)) & (characters 2 through 6 of (item 3 of kL)) & (characters 19 through 23 of (item 1 of kL))) as string
end gK
(* * * * * * Sample handler to show usage * * * * * * * * * * *)
to processInput(inString, inAction)
set outString to ""
if (inString is not "") then --> Process any incoming string
if (inAction is "Encrypt") then
set {encMode, inAction} to {"e", "Decrypt"}
else if (inAction is "Decrypt") then
set {encMode, inAction} to {"d", "Encrypt"}
end if
set outString to (eS(inString, gK(), encMode))
end if
set userInput to (display dialog "Your message:" default answer outString buttons {"Decrypt", "Cancel", "Encrypt"} default button inAction)
set {inString, inAction} to {(text returned of userInput), (button returned of userInput)}
processInput(inString, inAction)
end processInput