]> git.saurik.com Git - apple/security.git/blob - SecurityTests/cspxutils/cryptTool/runCrypt
Security-57031.10.10.tar.gz
[apple/security.git] / SecurityTests / cspxutils / cryptTool / runCrypt
1 #! /bin/csh -f
2 #
3 # Simple script to demonstrate usage of cryptTool.
4 #
5 # create a simple text file; dump its contents;
6 # encrypt the file using RC4;
7 # dump the binary contents of the resulting ciphertext;
8 # decrypt using RC4;
9 # dump the resulting plaintext file;
10 #
11 set PLAINTEXT_FILE=ptext
12 set CIPHERTEXT_FILE=ctext
13 set RECOVERED_FILE=rptext
14 #
15 echo Creating plaintext....
16 echo "This is a simple plaintext file for demonstration." > $PLAINTEXT_FILE
17 echo Contents of plaintext:
18 cat $PLAINTEXT_FILE
19 echo Encrypting plaintext...
20 ./cryptTool e foobar 16 $PLAINTEXT_FILE $CIPHERTEXT_FILE
21 echo Contents of ciphertext:
22 /usr/bin/hexdump $CIPHERTEXT_FILE
23 echo Decrypting....
24 ./cryptTool d foobar 16 $CIPHERTEXT_FILE $RECOVERED_FILE
25 echo Contents of recovered text:
26 cat $RECOVERED_FILE
27 echo Done.