Salsa20 (and its improved variant ChaCha) are relatively new stream ciphers developed by Professor Daniel J. Bernstein. Both are built on pseudorandom functions that only use three operations: 32-bit addition, bitwise addition (XOR) and rotation. (See Salsa20's Wiki page - [url removed, login to view])
I need you to write a VB6 project that shows a simple encrypt & decrypt demo (ie. just a couple of textboxes and buttons), using either Salsa20 (or preferably ChaCha, as it's a slightly improved variant), with all of the code in VB6. (ie. no calls to 3rd-party libraries or APIs etc... just pure VB6 code)
You'll need to port/translate Bernstein's original C sources for this:
Salsa20: [url removed, login to view]
ChaCha: [url removed, login to view]
As you can see it's a fairly small and simple cipher, but I'm not good at reading C! ...
[url removed, login to view]
As a part of this project I'll also need you to make and compile a C or C++ version which uses Bernstein's original source code so that I can use it to test and compare that your VB6 version is encrypting and decrypting the same as Bernstein's.
The demos (both the VB6 and C or C++ ones) simply need to demonstrate how to accept a line of text (whether its a VB Textbox or simply a commandline parameter), and encrypt and decrypt it. A simple demo of the stream cipher.
Just to be specific, I need you to make two programs ... one Visual Basic app (it must be VB6), and one C or C++ app which uses Bernstein's original code. The programs are extremely simple, as all they need to do is demonstrate encryption and decryption.
Preferably I'd like you to use ChaCha rather than Salsa20 ... from a programming point-of-view they're both almost the same, but ChaCha is the more efficient variant of the two.
Both programs do the same thing (the following filenames can be hard-coded in the source code):
1) Read C:\ChaCha\KEY.DAT to read the key to use for both encryption/decryption
2) Read C:\ChaCha\IV.DAT to read the IV to use
3) Read C:\ChaCha\INPUT.DAT to read the input data to encrypt
4) Encrypt the data, and save it to C:\ChaCha\ENCRYPTED.DAT
5) Decrypt the encrypted data, and save it to C:\ChaCha\DECRYPTED.DAT
Both programs should be compatible with each other, to confirm correct implementation. (For example, you should be able to encrypt with the VB6 app, then decrypt using the C/C++ app, and vice versa)