aes

How to convert a byte array to a string?

Hi, Using the function from: http://msdn.microsoft.com/en-us/library/system.security.cryptography.rijndaelmanaged.aspx public static byte[] encryptStringToBytes_AES(string plainText, byte[] Key, byte[] IV) As you can see it returns a byte array, I want to convert the byte array to a string. How can I convert it from a byte array to ...

What's the difference between SHA and AES encryption ?

What's the difference between SHA and AES encryption? ...

Java 256bit AES Encryption

I need to implement 256 bit AES encryption, but all the examples I have found online use a "KeyGenerator" to generate a 256 bit key, but I would like to use my own passkey. How can I create my own key? I have tried padding it out to 256 bits, but then I get an error saying that the key is too long. I do have the unlimited jurisdiction pa...

Calculate maximum size for encypted data

Is there any way to calculate the largest outcome from an Rijndael encryption with a fixed array lenght? Encryption method: RijndaelManaged Padding: PKCS7 CipherMode: CBC BlockSize 128 KeySize: 128 I need this as im converting a database where all string are going to be encrypted so i need to change the size of all string fields. ...

How many characters to create a byte array for my AES method?

Hi, I am using the AES methods here: http://msdn.microsoft.com/en-us/library/system.security.cryptography.rijndaelmanaged.aspx I want to have a string value that I will convert to byte array and pass it to the AES encrypt method. How many characters should the string be to produce the correct byte array size that the method expects? ...

Breaking AES encryption using decrypted data

After a discussion about encryption, a friend of mine challenged me to crack a file he encrypted using AES with a 128bit key. I know the file was originally a GIF image, so it should start with 'GIF8'. I'm wondering if it is possible to derive the password from this knowledge in a reasonable time (ie. a week or less). Stealing the key ...

What block cipher mode to use? CFB adequate?

I want to use AES to encrypt some data of arbitrary length, and I'm wondering what block cipher mode I should use. http://www.daemonology.net/blog/2009-06-11-cryptographic-right-answers.html recommends AES in CTR mode. I'm writing a Ruby on Rails plugin, and unfortunately OpenSSL (which Ruby has standard bindings for) doesn't support CTR...

Pad byte[] to 16-byte multiple for AES Encryption

I currently have a function [C#] which takes a byte[] and an alignment to set it to, but during encryption, an error is thrown every once in awhile. private byte[] AlignByteArray(byte[] content, int alignto) { long thelength = content.Length - 1; long remainder = 1; while (remainder != 0) { ...

Writing an encrypted cookie session store for Rails; is my approach secure?

By default, Ruby on Rails stores session data in cookies. This has many advantages, such as the lack of need to setup any persistence layers on the server side. However, the session data is not encrypted, and the Rails app that I'm writing puts potentially sensitive data in the session. I'd like to avoid storing session data server-side ...

Getting SlowAES and RijndaelManaged class in .NET to play together

Hi, I'm trying to setup AES encryption / decryption using the javascript library SlowAES and the RijndaelManaged class in .NET. I chose this method after reading this post, where Cheeso has managed to get these two encryption methods to play together "In my tests of the COM-wrapped-SlowAEs, I used CBC mode, and the encryption...

Create ZIP with AES encryption on Solaris

Hi, Is there a way to archive & encrypt a file using AES on Solaris and be able to unencrypt & unarchive it with winzip? Thnaks! Mark ...

"Unlimited Strength" JCE Policy Files

I have an app that uses 256-bit AES encryption which is not supported by Java out of the box. I know to get this to function correctly I install the JCE unlimited strength jars in the security folder. This is fine for me being the developer, I can install them. My question is since this app will be distributed, end users most likely wil...

Which is more secure OFB or CFB?

I'm working a small project, using AES encryption and wanted to use it in streaming mode, which is considered a more "suitable" mode for socket usage? OFB or CFB? I've been reading about it and can't really decide, so any ideas are highly appreciated. I'll be using OpenSSL/C++. ...

How to choose an AES encryption mode (CBC ECB CTR OCB CFB)?

Which of them are preferred in which circumstances? I'd like to see the list of evaluation crtieria for the various modes, and maybe a discussion of the applicability of each criterion. For example, I think one of the criteria is "size of the code" for encryption and decryption, which is important for micro-code embedded systems, lik...

Can I exploit GPU to do AES encryption from .NET? If so, how?

Interesting paper from Trinity College of Dublin: AES Encryption Implementation and Analysis on Commodity Graphics Processing Units Their technique uses openGL to enlist the GPU to do the numeric transforms required by AES. How difficult would it be to expose this capability - performing stream encryption - via a managed .NET library?...

Java cipher.doFinal() writing extra bytes

I'm implementing encryption / decryption using Java Cipher and AES. Everything is working well except that there's 5 extra bytes written on the call to doFinal(). So, I end up with a correctly decoded string with 5 extra bytes appended. I believe the reason is that the entire block of 16-bytes is being written. I see 3 16-byte blocks...

When would I choose AesCryptoServiceProvider over AesManaged or RijndaelManaged?

I think the distinguishing factors are AesCryptoServiceProvider is FIPS compliant AesManaged is cross-platform, requires .NET 3.0 RijndaelManaged runs on .NET 2.0, requires restricting the blocksize is that about right? ...

Cryptography: best practices for keys in memory?

Background: I got some data encrypted with AES (ie symmetric crypto) in a database. A server side application, running on a (assumed) secure and isolated Linux box, uses this data. It reads the encrypted data from the DB, and writes back encrypted data, only dealing with the unencrypted data in memory. So, in order to do this, the app is...

Java PBEWithMD5AndDES

I am using password based encryption. My initial thought was to use AES to encrypt the file which contains passwords. Turns out password based encryption does not support AES. It uses DES. AFAIK des is not secure. Is PBEWithMD5AndDES secure enough to thrust my data or should i look for another implementation? ...

Is there non-linear difference between strong (i.e. AES) and non-strong (i.e. classic zip) encryption

AES and other modern encryption algorithm are considered strong and sometimes one can see quotes like "it's not recommended to use classic zip encryption since it is no longer considered strong". But is there a really non-linear difference between them? For example, if both produce sequences with high entropy, does it mean that with a ve...