1

I'd like to use Applescript to connect to my remote website. However, I don't like the idea of having my password/username in my script in plain text. Is there anyway to encode a password in a local script on my computer?

Thank you,

Eric

3
  • 1
    Look at this: stackoverflow.com/questions/604634/… Commented Jan 30, 2013 at 19:48
  • 1
    I just answered this today for someone, see my post here stackoverflow.com/questions/14598849/… Commented Jan 30, 2013 at 20:24
  • Thank you both for responding! Both posts responses were helpful, especially reulus6633's. Commented Jan 30, 2013 at 20:54

1 Answer 1

0

Well you're not the first one that asks this question but you have to ask yourself some questions. Like who is gonna use it and from who do I need to protect it.

Step 1: To make sure that your code is protected you should save two different kind of AppleScripts. The first one is for you, and you only. This version is compiled but be able to open with Script editor again so you can see the source code. The second is a run only script which is much like the first version but your not able to open it in Script editor again as a document to view it's source code.

step 2: The second thing you don't want is that there is static text about user credentials because, even if it's compiled, you can see static text. Normally you won't see them but when the user credential is an mail address it's an easy find. But before we solve this issue, do you think someone is clever enough to find the user credentials from compiled AppleScript code? If so then the easiest way of encoding is adding a certain value to Unicode values:

property eusn : "¨®¦ÅÞÞÍÉ»ÅÞÞÍÉ"
property epwd : "ÔÅ××ÛÓÖÈ"

set usn to simpleDecryption(eusn)
set pwd to simpleDecryption(epwd)

on simpleEncryption(_str)
    set x to id of _str
    repeat with c in x
        set contents of c to c + 100
    end repeat
    return string id x
end simpleEncryption

on simpleDecryption(_str)
    set x to id of _str
    repeat with c in x
        set contents of c to c - 100
    end repeat
    return string id x
end simpleDecryption

Store statics as encrypted strings and when its needed, decrypt them. Remember that properties are persistent, unlike local variables, so don't store plain data in properties in your case.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.