LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-15-2009, 03:15 AM   #1
CMV123
LQ Newbie
 
Registered: Jun 2009
Posts: 1

Rep: Reputation: 0
Problem when trying to decryp encryped file with CryptoPP


Hi all,

I have a problem.

Someone I know encrypted a text file using AES128 by using binary key file, (He generate the binary key).
After that he uses "base64Encode" over the encryped file

I have the private binary key file.
Now, when I'm trying to decrypt the file, I do as follow:
1. Use "Base64Decoder" to get the encrypted file --> Pass successfully
2. Use the following:

Try using both functions:
Quote:
FileSource f(in, true, new DefaultDecryptorWithMAC(passPhrase, new FileSink(out)));
Quote:
FileSource f(in, true, new DefaultDecryptor(passPhrase, new FileSink(out)));
where:
in - is the input file (encrypted file)
passPharse - char* - location of the key file


but I always getting the following error:
Quote:
terminate called after throwing an instance of 'CryptoPP:efaultDecryptor::KeyBadErr'
what(): DefaultDecryptor: cannot decrypt message with this passphrase

Now when I'm trying to encrypt and decrypt by myself it works fine,
(I'm using the binary key he gave me)

Quote:
1. FileSource f(in, true, new DefaultEncryptorWithMAC(passPhrase, new FileSink(out)));
2. FileSource(in, true, new Base64Encoder(new FileSink(out)));
3. FileSource(in, true, new Base64Decoder(new FileSink(out)));
4. FileSource f(in, true, new DefaultDecryptorWithMAC(passPhrase, new FileSink(out)));

Could anyone help me, to understand what is my problem,
I'm guessing that the problem could be from 2 reasons:
1. Because this is a different algorithm form java AES128
2. There is a problem in the key, It can't read it right
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ problems linking with CryptoPP rever111 Programming 1 03-18-2009 04:17 PM
Is there a way to compile cryptopp from source? Choucete Linux - Newbie 6 09-02-2008 04:17 AM
wxPython problem: /_core_.so: cannot open shared object file: No such file or directo aregmi Linux - Software 2 06-06-2007 08:53 PM
LXer: CryptoPP - The cryptographic library for C++ LXer Syndicated Linux News 0 04-22-2007 11:31 PM
vsftp encryped login/communication? cjpsparks Linux - Software 10 12-28-2003 06:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration