I have been searching for a while for a crypto library that I can used on linux to implement HC-128/256 encryption for using on network traffic. Unfortunately, support for this seems rather rare. Bouncy Castle supports it for C# and Java, but I need it for C. I have the source code for the HC-128/256 algorithms, but no examples on how to actually use it.
HC-256 Wikipedia:
http://en.wikipedia.org/wiki/HC-256
HC-128 Source Code and Article:
http://www.ecrypt.eu.org/stream/hcp3.html
Any help?
I created a CRYPTOSOCKET class for encrypted comms. It also has a public "encrypt" and "decrypt" function. The socket part really just does encrypt/decrypt and calls send/recv for you. The "socket" functionality of it can be easily stripped out.
This is C++. If you want C, just look at the encrypt and decrypt functions of the CRYPTOSOCKET class and the constructor. Its very simple. Also, this is HC-256, not HC-128.
In a header "crypto.hpp".
And inside "crypto.cpp":
And inside "ecrypt-sync.h":
Then use "ecrypt-machine.h", "ecrypt-config.h", and "ecrypt-portable.h" from here: http://www.ecrypt.eu.org/stream/p3ciphers/hc/hc256_p3source.zip
Here is a quick application to test it. You will have to create the "generateRandom" function, or just make up some random bytes lol.