Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Apr 20, 2006, 05:58 PM   #1
hochresmos
macrumors newbie
 
Join Date: Apr 2006
Location: Ancient History
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.

(Mathematical Explanation)

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.
Thanks!
hochresmos is offline   0 Reply With Quote
Old Apr 21, 2006, 02:26 AM   #2
kainjow
Moderator emeritus
 
kainjow's Avatar
 
Join Date: Jun 2000
OpenSSL does encryption stuff. It's built-in to OS X.

And what you're wanting to do with the terminal and text edit is called shell scripting. Google it
kainjow is offline   0 Reply With Quote
Old Apr 23, 2006, 07:18 PM   #3
superbovine
macrumors 68030
 
superbovine's Avatar
 
Join Date: Nov 2003
Quote:
Originally Posted by kainjow
OpenSSL does encryption stuff. It's built-in to OS X.

And what you're wanting to do with the terminal and text edit is called shell scripting. Google it
*cough cough* and perl...
superbovine is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Need help on script flash1996 Mac Basics and Help 1 Oct 28, 2013 09:22 PM
need help on script flash1996 OS X 0 Oct 27, 2013 01:47 PM
Apple script batch shell script prramesh Mac Programming 5 Sep 15, 2013 03:35 AM
first script/autamator script feed back zyr123 Mac Programming 1 Jul 17, 2012 10:00 AM
Help with a script GabooN Mac Programming 3 Jul 4, 2012 08:53 PM

Forum Jump

All times are GMT -5. The time now is 01:11 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC