aes

Any way to unencrypt pkcs7 padded aes 256 cbc from ruby?

Im constantly getting "bad decrypt" whilst trying to unencrypt a string from a c# program using the same iv on both sides. This is getting a bit annoying and I cant really figure out the problem. This is the ruby code def unencrypt(message) c = OpenSSL::Cipher::Cipher.new("aes-256-cbc") c.padding = 1 c.decrypt c.key = key = Dig...

Is it safe to use PBKDF2 with SHA256 to generate 128-bit AES keys?

I want to use PBKDF2 with some cryptographic hash function to generate 128-bit AES keys. SHA1 is also 128-bit, so I thought of using that with PBKDF2, but it was broken, so I have opted to use SHA256 instead. Is this safe, or will the difference between the hash size and resulting key size cause some sort of disastrous silent truncation ...

AES Encryption for an NSString on the iPhone

Can anybody point me in the right direction to be able to encrypt a string, returning another string with the encrypted data? (I've been trying with AES256 encryption.) I want to write a method which takes two NSString instances, one being the message to encrypt and the other being a 'passcode' to encrypt it with - I suspect I'd have to ...

How to implement Java 256-bit AES encryption with CBC

Hi, I've read the following threads and they've helped a little, but I'm looking for a little more info. How to write AES/CBC/PKCS5Padding encryption and decryption with Initialization Vector Parameter for BlackBerry Java 256bit AES Encryption Basically, what I am doing is writing a program that will encrypt a request to be sent over...

Phone-To-Server communication encryption in Java

Hi, This goes along with another thread, here: How to implement Java 256-bit AES encryption with CBC Mainly, trying to get AES encryption on a phone using Java. My question here is how to handle the encryption key. I don't know if I should store the key, hash the key and use that, or do a public-key-encyption scheme. I would rather ha...

Using MD5 to generate an encryption key from password?

I'm writing a simple program for file encryption. Mostly as an academic exercise but possibly for future serious use. All of the heavy lifting is done with third-party libraries, but putting the pieces together in a secure manner is still quite a challenge for the non-cryptographer. Basically, I've got just about everything working the w...

Invalid Algorithm Specified CryptoAPI

I am trying to decrypt something using 128BIT AES Decryption. When i attempt to calling CryptDecrypt i get an Error stating "Invalid Algorithm Specified". I get the same problem when using the library posted here: http://www.codeproject.com/KB/security/WinAES.aspx What can cause this error? I am using CryptoAPI along on vista64bit with...

How to communicate AES initialization Vector to client for hybrid cryptosystem.

I need to implemented security for client-server communication. I have implemented the following hybrid cryptosystem: http://en.wikipedia.org/wiki/Hybrid%5Fcryptosystem To encrypt a message addressed to Alice in a hybrid cryptosystem, Bob does the following: Obtains Alice's public key. Generates a fresh symmetric key for the data enca...

Which of the encryption aproaches should I use?

I need a system to exchange very secret data (source code that is a trade secret). I will use Crypto++ so practically I can use all encryption algorithms, although I really prefer to use an industry standard. Currently I'm thinking on these methods: Have the server generate 2048/4096-bit RSA keys, send the public key over to the clien...

XTS-AES Mode in C#

Is it possible to use AES in XTC mode in C# (.net 3.5)? It doesn't seem to be in the CipherMode enumeration. I cannot seem to find any implementations of it on the web. ...

AES Algorithm S Box uniqueness

Hi This is regarding AES algorithm. Suppose i have implemented a AES algorithm and encrypt data using my algorithm. Now suppose somebody else also has implemented the same AES algorithm (128 bit). Now if i encrypt a data using my algorithm is it possible for decrypting the data and getting back the original data using the second algor...

How to do AES256 decryption in PHP?

I have an encrypted bit of text that I need to decrypt. It's encrypted with AES-256-CBC. I have the encrypted text, key, and iv. However, no matter what I try I just can't seem to get it to work. The internet has suggested that mcrypt's Rijndael cypher should be able to do this, so here's what I have now: function decrypt_data($data, $...

Perl & Ruby exchange AES encrypted information

What is the equivalent to Crypt::CBC in Perl for Ruby? Note: This problem similar to PHP/Perl at stackoverflow:655691. Perl Version use Crypt::CBC; use MIME::Base64::Perl; my $cipher = Crypt::CBC->new( -key => "95A8EE8E89979B9EFDCBC6EB9797528D", -keysize => 32, -cipher => "Crypt::OpenSSL::AES" ); $encypted = $ci...

Links for AES 128 bit CFB Implemenation or sample application

Hi Does anybody know sample application or link where i can test 128 bit AES CFB implemenation given a password and some data. Thanks ...

AES difference between iPhone (Objective-c) and Java

Hi all, I have been tearing my hair out all day trying to solve this... I have an objective-c client running on the iPhone, connecting to a Java server. The iPhone is encrypting data using AES but I cannot decrypt it on the server. I am using a known passphrase and message (single string) and am generating the byte array on the iPhone...

Compile mysql for AES 256bits

According to mysql document "Encoding with a 128-bit key length is used, but you can extend it up to 256 bits by modifying the source." But they didn't seem to provide instruction where to change. Anyone experience with this situation? which source file should change? Note: I use these steps to compile. ...

Verify key is correct using pyCrypto AES decryption

How do I verify the correct key is being used to decrypt AES encrypted data using pyCrypto AES? cipher = AES.new(key, AES.MODE_CFB) cipher.decrypt(s) If an incorrect key is used, it still attempts to decrypt the data, obfuscating it more. Is there any test I can do to prove the data is being decrypted to the original state? ...

Decryption type and breaking (AES 128?)

Hi, My question has 2 parts. The first one is "what possible type of encryption i am on" and the other is, "what is the chance of breaking it" (as soon as the encryption algorithm was found). So, I got the original file and the encrypted one and I was able to test the behaviour of the encrypted when something changes in the original. T...

Strength of RSA Encrypting an AES Key

I'm currently developing a system to transmit data between client and server, and was wondering what the strength of the encryption I planned to use was. My thought was to have a private/public RSA key pair and hand out the public key to each client (leaving the private key solely on the server). Each client would then generate their ow...

file size is dramatically increased after pickle

I'm reading in a file and sending the data (once encrypted) to a dictionary, with a hash of the data before and after encryption. I then pickle the dictionary but find the file size is massive compared to the source file size. If I write the encrypted data straight to a file the size is identical to the source. Any idea why my pickled fi...