decryption

Transferring cryptographic initialization vectors

I want to know the best way of transferring a cryptographic initialization vector (IV) from the place where my data is encrypted to the place where my data is decrypted. In other words, the IV should be randomly generated every time you encrypt a message (right?), so there needs to be some way of finding the IV when you decrypt. I have...

How can I decrypt a file encrypted in Perl using Crypt::CBC (Blowfish) in C?

I have a small encryption tool in Perl which uses the Crypt::CBC and Blowfish to encrypt files. I want to write the decryption algorithm in C or C++ ... Please somebody help me in doing this. ...

What is the best way to encrypt a text file in C/C++?

A C/C++ based cgi web application will be creating a temporary text file on the server as long as the user is logged in. The text file will be deleted when the user logs off. I want to encrypt this text file and also the content of the file. The file will contain information like username and password. What is the best way to do this? ...

What encryption algorithm is best for encrypting session file on the server?

Possible Duplicate: What is the best way to encrypt a text file in C/C++? It may sound weird but there is a C++ web application (CGI). Every new request creates a new process. So in order to maintain session a text file will be created on the server which will contain info like sessionid, username, password, timestamp etc. This ...

Error decrypting file

Hi, i encrypt a file using ideas from tldp.org/LDP/LG/issue87/vinayak.html. I downloaded and compiled this source code for encrypting/decrypting a simple text file. Once compiled I do: ./blowfish input_file.txt output_enc.txt output_dec.txt I use the options: G for generating a key E for encrypting the file, so output_enc.txt is ...

Should I Trim the Decrypted String after mcrypt_decrypt?

I have a code that goes something like: $cipher_alg = MCRYPT_RIJNDAEL_128; $decrypted_string = mcrypt_decrypt($cipher_alg, $key, $encrypted_string , MCRYPT_MODE_CBC, trim(hex2bin(trim($hexiv)))); I worry that in the process of decoding the mcrypt_decrypt will introduce a gratuitous whitespace or null characters at the back or front o...

MD5 to Blowfish encryption?

Can anyone give me an idea bout this.. I was assigned to decrypt passwords from our LDAP DB and then encrypt them using blowfish algo since we are going to use openfire system. Transfer of data from one DB to another is not that much of a problem, just these "passwords".. Is there any way to convert MD5 encryption to blowfish? am i going...

Having trouble decrypting in C# something encrypted on iPhone using RSA

I've spent two days on this so far and combed through every source at my disposal, so this is the last resort. I have an X509 certificate whose public key I have stored in the iPhone's keychain (simulator only at this point). On the ASP.NET side, I've got the certificate in the cert store with a private key. When I encrypt a string on t...

Hash Collision in fairly simple encrypt/decrypt code

I'm trying to add a small level of security to a site and encode some ids. The id's are already a concat of linked table rows, so storing the encryption in the db isn't very efficient. Therefore I need to encode & decode the string. I found this great little function from myphpscripts, and I'm wondering what the chances are of collisio...

Python RSA Decryption Using OpenSSL Generated Keys

Does anyone know the simplest way to import an OpenSSL RSA private/public key (using a passphrase) with a Python library and use it to decrypt a message. I've taken a look at ezPyCrypto, but can't seem to get it to recognise an OpenSSL RSA key, I've tried importing a key with importKey as follows: key.importKey(myKey, passphrase='PASS...

How to do encryption/decryption in xml with StAX?

Hi, One of the reason I use StAX is because of it low memory consumption in processing large xml files. I've been requested to encrypt the whole xml files, and decrypt them later. The easier solution I can come up with, without having major change to existing code, is encrypt content only. xsw.writeStartElement("row"); xsw.writeC...

few characters missing after decryption.

Hi, This is my original xml: <?xml version="1.0" encoding="UTF-8"?> <table> <row> <id>12</id> <name>Mickey Mouse</name> </row> </table> This is the output after going through encryption/decryption process <?xml version="1.0" encoding="UTF-8"?> <table> <row> <id>12</id> <name>Mickey Mouse</name> </...

Encryption: reversing bitwise and bitshift?

I'm trying to reverse an XOR encryption. I have the encryption code: // Walk the 16 nibbles in the 64 bit long long, selecting the corresponding key digit // and XORing it into the result. unsigned long long result = 0; for( i=0; i<16; i++ ) { int n = 4*(i % keyLen); int k = (key & (0xF << n)) >> n; result |= value&(0xF << 4...

Is it possible to decrypt md5 hashes?

Someone told me that he has seen software systems that would accept MD5 encrypted passwords (through various integrations with other systems), decrypt them, and store them in the systems own database using it's own algorithm. Is that possible? I thought that it wasn't possible (feasible) to decrypt MD5 hashes. I know there are MD5 dic...

Decrypt BlowfishEasy encrypted file in PHP

I am trying to figure out how to decrypt a file that is encrypted with BlowfishJ.BlowfishEasy. Anyone who has Java and PHP experience and would be willing to help would be great! BlowfishEasy Class: https://opensource.at.northwestern.edu/trac/filebridge/browser/tags/1.0.2/source/encryption-src/BlowfishJ/BlowfishEasy.java Decrypt Call C...

PHP Encryption & VB.net Decryption

I'm trying to do a simple task. Encypt a value in PHP and Decrypt it in my VB.net app. I figure I'd use tripleDES or Rijdael 128 or 256 I though this should be simple. Can anyone point me in the right direction? Thank you ...

Encrypting JSON in Google Gears Workerpool

Hello, I need to encrypt JSON (stringified) data in a Google Gears Workerpool. So far, any implementation I tried either makes the Gears Workerpool bug out, or gives me unwanted encrypted strings. For example: DES encryption (can't post URL due to account restrictions) This works brilliantly for most applications, except after encrypti...

Padding error when using RSA Encryption in C# and Decryption in Java

Currently I am receiving the following error when using Java to decrypt a Base64 encoded RSA encrypted string that was made in C#: javax.crypto.BadPaddingException: Not PKCS#1 block type 2 or Zero padding The setup process between the exchange from .NET and Java is done by creating a private key in the .NET key store then from the ...

System.Security.Cryptography.ProtectedData method with DataProtectionScope.LocalMachine parameter. Is use of this parameter effected by a change in machine name?

We're using System.Security.Cryptography.ProtectedData method Protect with the DataProtectionScope.LocalMachine parameter to encrypt some data we keep in the database. My question is this: If we encrypt some data this way and then change the machine's name, will we still be able to decrypt the data encrypted on that machine? Is the ...

Need Encrypted connection string and stmp information in the web.config

I want to keep encrypted connection string and stmp information in the web.config. can I store Connection String and SMTP information in web.config encrypted and where I need just decrypted and use? OR What is the point/event where i can encrypt the Connection String and SMTP and save in the web.config? (and if the changes happen in w...