Keystroke Encryption in Applescript?

Hey all,

Does anyone know of a keystroke encryption method through applescript or terminal?
i.e. a way to scramble all keystrokes so any potential keyloggers running on the system would not work?

I know this is probably reaching, but thanks in advance.

i’m not sure if it’s just general prevention that you are looking for, but take a look at this, it may help:

There’s some useful info there on protecting your computer against keyloggers, but my purposes are different.

I have a password-protected PDF and an app that keystrokes (tell app “system events” to keystroke password & return) the PDF’s password into the open password field of Adobe Reader.

If someone discovered the keystroking method, they could install a keylogger program that would record the password, character for character, as it was keystroked.

I know this is probably not very likely, but is there any solution to this problem, any way of encrypting a string of characters or just scrambling the keystrokes so a keylogger would turn up gibberish? I know there are programs like that, but the problem for me is that it would have to use bash or applescript so it could be run from within my app.

Any help is greatly appreciated. Thanks!