Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Encrypt in C and decrypt in Perl

by hippo (Bishop)
on Dec 05, 2022 at 09:49 UTC ( [id://11148564]=note: print w/replies, xml ) Need Help??


in reply to Encrypt in C and decrypt in Perl

In the Examples section of the Crypt::CBC documentation it says:

Three examples, aes.pl, des.pl and idea.pl can be found in the eg/ subdirectory of the Crypt-CBC distribution. These implement command-line DES and IDEA encryption algorithms using default parameters, and should be compatible with recent versions of OpenSSL.

This suggests that it is certainly possible. Did you try running those examples? They are probably a good place to start.


🦛

Replies are listed 'Best First'.
Re^2: Encrypt in C and decrypt in Perl
by csrzhd (Novice) on Dec 05, 2022 at 18:28 UTC
    Thank you, hippo. It turned out that I was reading the manual of Crypt::CBC of which the version is newer than the package installed in my Linux. Therefore, some features such as SHA-256 key derivation algorithm and -pbkdf=>'pbkdf2' are not available in my system. After removing related codes in my Perl script, it works finally. My C++ application can now decrypt data that was encrypted by Perl script, and vice versa.

      Just a tip for future reference: about halfway down the panel on the left-hand side (on both the module & distribution pages) you'll see a selection list with "Jump to version" — use this to align with whatever version you're working with. This is true for most (if not all) modules; it's not specific to Crypt::CBC.

      — Ken

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11148564]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2024-04-25 15:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found