[Update] I am offering a bonus for this. Frankly, I don’t care which encryption method is used. Preferably something simple like XTEA, RC4, BlowFish … but you chose.
I want minimum effort on my part, preferably just drop the files into my projects and build.
Idealy you should already have used the code to en/de-crypt a file in Delphi and C (I want to trade files between an Atmel UC3 micro-processor (coding in C) and a Windows PC (coding in Delphi) en-and-de-crypt in both directions).
I have a strong preference for a single .PAS unit and a single .C/.H file. I do not want to use a DLL or a library supporting dozens of encryption algorithms, just one (and I certainly don’t want anything with an install program).
I hope that I don’t sound too picky here, but I have been googling & trying code for over a week and still can’t find two implementations which match. I suspect that only someone who has already done this can help me …
Thanks in advance.
As a follow up to my previous post, I am still looking for some very simple code with why I can – with minimal effort – en-de crypt a file and exchange it between Delphi on a PC and C on an Atmel UC3 u-processor.
It sounds simple in theory, but in practice it’s a nightmare. There are many possible candidates and I have spend days googling and trying them out – to no avail.
Some are humonous libraries, supporting many encryption algorithms, and I want something lightweight (especially on the C / u-processor end).
Some look good, but one set of source offers only block manipulation, the other strings (I would prefer whole file en/de-crypt).
Most seem to be very poorly documented, with meaningless parameter names and no example code to call the functions.
Over the past weekend (plus a few more days), I have burned my way through a slew of XTEA, XXTEA and BlowFish implementations, but while I can encrypt, I can’t reverse the process.
Now I am looking at AES-256. Dos anyone know of an implementation in C which is a single AES.C file? (plus AES.H, of course)
Frankly, I will take anything that will do whole file en/de-crypt between Delphi and C, but unless anyone has actually done this themselves, I expect to hear only “any implementation that meets the standard should do” – which is a nice theoory but just not working out for me 🙁
Any simple AES-256 in C out there? I have some reasonable looking Delphi code, but won’t be sure until I try them together.
Thanks in advance …
Here is RC4 code. It is very lightweight.
The C has been used in a production system for five years.
I have added lightly tested Delphi code. The Pascal is a line-by-line port with with
unsigned chargoing toByte. I have only run the Pascal in Free Pascal with Delphi option turned on, not Delphi itself. Both C and Pascal have simple file processors.Scrambling the ciphertext gives the original cleartext back.
No bugs reported to date. Hope this solves your problem.
rc4.h
rc4.c
Here is lightly tested Pascal. I can scramble the source code in C and descramble it with the Pascal implementation just fine.