So I have been saying I was going to post these for a while, and now I am finally getting around to it. They are four programs that I wrote for my crypto class.

The first one cracks an affine cipher by using a brute force approach.
http://pastebin.com/ttLFRcZ5
There are no special compiler flags required, and to use it, type:

Code:
cat input.txt | ./Cipher | more


The second one uses the aspeller library to show all possible five letter words, and possible english encryptions with a rot cipher.
http://pastebin.com/ZvM1SEB2
To compile you need to use the -laspell compiler flag. Then to run

Code:
./Matches


The third one implements a simple spn, for encrypting and decrypting. As two seperate programs. Here they are respectively.
http://pastebin.com/SUbsRABT
http://pastebin.com/f8SuLH5G
These require no special compiler flags. To run type:

Code:
./Encrypt number_of_rounds key0 keyNr < input.txt > output.txt
./Decrypt number_of_rounds key0 keyNr < output.txt > test.txt


And finally the last one is not really cryptoish, but it is a very basic big nums class, that allows for subtraction, addition, and multiplication. And it has been pointed out to me that it has issues with -0 and I have yet to fix it. In order these are bignum.h, bignum.cpp, and test.cpp.
http://pastebin.com/HWgaP4RW
http://pastebin.com/nA7ux3Hg
http://pastebin.com/4w38ggBM

Compiling for this is very basic as well. To compile just

Code:

g++ bignum.cpp -c
g++ bignum.o test.cpp -o Test


Then to run type

Code:
./Test
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement