Pretty much anything under the Crypt:: namespace will work. In fact, most of them are just Perl interfaces on top of a C library. As long as you use the same algorithm (AES is a good choice) and the same encryption mode (use CBC unless you have a specific reason not to), there's no reason you can't decrypt on the C side of things.
"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.
| [reply] |
thanks!
Hmm I'd love to use Crypt::CBC, or Crypt::* whatever, but looking at the source code, so far I don't really see them utilizing any of the underlying C functions, looks perl impelmented.
I'll keep digging through some of these, I may be missing it.
| [reply] |
An algorithm is language agnostic. That is to say that any encryption algorithm should operate the same regardless of wheter it was implemented in Perl, C, COBOL, Fortran, Lisp, etc... So, let's say that you choose DES. There's a DES module for Perl, and I'm sure with a bit of searching, you can find a C implementation of it. You can write your respective programs around those two libraries; your Perl program around the Perl module, and the C program around the C library. Easy, peasy, Japanese-y.
thor
Feel the white light, the light within
Be your own disciple, fan the sparks of will
For all of us waiting, your kingdom will come
| [reply] |
If you want something simpler, look at rc4. There are alot of rc4.c code examples out there, just google for "rc4 c".
There is a Crypt::RC4 module, and you might want to look at it's perldoc. I think your biggest problem will be making sure the keys are the same. Many encryption algorithms pad the keys to be a certain length, and you will need to make sure you do it the same in c and perl, or it won't work.
I'm not really a human, but I play one on earth.
flash japh
| [reply] |