|Apr 20, 2006, 05:58 PM||#1|
Cryptology Script Help
I'm currently a college student taking a Cryptology course just making the jump from Windows to Mac, and I was looking for a way to automate some of the repetitive tasks necessary for RSA encryption. I have some Applescript experience, but I cannot manage to get anything to work. Any help would be incredibly well received.
The cryptology programs I need to automate are all executables and are used through terminal. RSA encryption uses a very simple equation: a^k mod n [where "a" is your message converted to numeric form (a=01, b=02,...), "k" is your public exponent (a number anyone can see) and "n" is a public modulus ("mod" is a function producing a quotient's remainder: 12 mod 5=2, 13 mod 5=3...)]. Encryption is attained through a multiplicative inverse ("d") of you public exponent, which is secret: thus a decryption formula of z^d mod n [where "z" is the encrypted numerical plaintext, "d" is the multiplicative inverse of "e," and "n" is the same modulus as above].
[more info: http://world.std.com/~franl/crypto/rsa-guts.html]
So, I know that Applescript can easily perform this type of math in its own interface, but I would much rather be able to create a script that would automatically 1) open a saved terminal session 2) open a certain textedit document 3) copy the first line of that textedit document 4) paste that line of text into terminal without executing the line 5) copy the second line of the textedit document 6) paste that line into terminal with a preceding space without executing the command 7) copy and paste the third line into terminal with a preceding space 8) execute the command line 9) close the textedit application leaving terminal as the active window.
My main problem is that I cannot get textedit to copy anything to the clipboard, I can only get it to copy blocks of text within a document with the "duplicate to" command. Also, terminal refuses to accept any pasted data (from other programs) without executing the line. Again, any help with any of the steps listed above would be greatly appreciated.
|Apr 23, 2006, 07:18 PM||#3|
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Run Script with Administrative Privileges during PackageMaker Installation||rebello95||Mac Programming||0||Nov 7, 2011 11:27 PM|
|Help making Bash Script work with Lion?||Yujenisis||Mac Programming||4||Sep 13, 2011 02:57 PM|
|iTunes Script Help||jason1989||Mac Programming||1||Jan 24, 2011 11:45 AM|
|Folder Action scripting help (or similar product to do this!)||m2uk||Mac OS X 10.3 (Panther) Discussion||0||Jan 13, 2004 11:28 AM|
|Apple Script Help!||damson34||General Mac Discussion||0||Oct 5, 2002 03:49 PM|
All times are GMT -5. The time now is 07:25 AM.