rijndaelmanaged

Thread Safety RijndaelManaged, ICryptoTransform.TransformFinalBlock?

Lets say we have this code that runs in the constructor: Dim initVectorBytes As Byte() = System.Text.Encoding.ASCII.GetBytes(initVector) Dim saltValueBytes As Byte() = System.Text.Encoding.ASCII.GetBytes(saltValue) Dim passPharse As String = GenerateKeyString(EncryptionKey) Dim password As Rfc2898DeriveBytes = New Rfc2...

How to decrypt a string in cobol

Hi i'm looking for ways to decrypt a string in cobol that was encrypted in .net using RijndaelManaged. I have control of the algorithm so it doesn't need to be Rijdnael, but i just need to ensure that the data is encrypted. Any help advice is appreciated. Thanks Sean [Edit] - the data is encypted in a c# windows service that i've cre...

ASP.NET Rijndael Encryption Error - Specified key is not a valid size for this algorithm.

I can't seem to get past this problem, I've created what I assume to be a 256-bit key using the random generator at GRC and combined that with my IV. I keep getting the error below: Specified key is not a valid size for this algorithm. Any help is gratefully received, here is the code I am using to Encrypt/Decrypt: Private Function R...

ASP.NET Rijndael Decryption Error: Length of the data to decrypt is invalid.

OK, so having just got the key to be accepted and have an encrypted string out which is 44 char long, I now am unable to decrypt (aarrgghh): Length of the data to decrypt is invalid. Having looked around and read various posts it looks as though the conversion to a Base64String may be the problem but I can't see where it is wrong - man...

Compression and encryption SOAP - ASP.NET web service

Hi everybody. I need advice. I zip and crypt SOAP message on web service and client side. Client is winforms app. If I only crypt SOAP message, it works good. If I only zip SOAP message it also works good. I use SOAP extension on crypt and zip SOAP. I use AES - Advanced Encryption Standard - Rijndael and on compresion I use Sharp...

Encypt 2 pieces of data separatly and export as one file via Rijmdael in C#

There are 2 buttons which will generate 2 piece of data. What I need to achieve is encrypt them separately and export to same file. Then I need be able to decrypt it later. Is it possible to use CBC mode? Using the same stream to encrypt the 1st block of the 2nd piece of data by the last block of the 1st piece of data? (To avoid IV) Or...

C# rijndael CryptoStream can I write to file bits and bits like the way textwriter does?

Was stuggling in how to encrypt 2 strings together. Because I add bits and bits string in real time (by str = str + bitString;) and at the end. I generate the string and encrpt it. Now the question is can I encypt and write the bitString in real time like textwriter? Something like: CrytoStream cr = new (outFile,xxx,write) cr.write(bit...

Passphrase, Salt and IV, do I need all of these?

If I am using Rijndael CBC mode, I have no idea why we would need salt. My understanding is even if people know the password, but he cannot get the data without IV. So from my perspective, password + IV seem to be sufficent secure. Do I get anything wrong? ...

How can I encrypt with AES in C# then decrypt it on Perl?

Here is my C# code. How could I decrypt this in Perl? Or I cannot decypt it in Perl due to OpenSSL? RijndaelManaged RijndaelAlg = new RijndaelManaged(); FileStream fStream = File.Open(FileName, FileMode.OpenOrCreate); byte[] initVectorBytes = Encoding.ASCII.GetBytes("11B2c3D4e5F6g7H8"); RijndaelAlg.IV = initVectorBytes; string password ...

ASP.NET MVC - Secure Temporary Storage of Credit Card Data

I have a checkout process for a shopping cart that is currently storing credit card data in the session for retrieval once the user finalizes the purchase. The purchase process is set up such that the user inputs the credit card, views a confirmation page, and then finalizes the order. The confirmation and finalization actions are the on...

How to decode Rijndael in ruby (encoded in VB.net)

Hello, I am using Rinjael to encode in VB.NET and need to decode in Ruby. My VB.NET encryption class looks like this: Private Class Encryptor Private symmetricKey As System.Security.Cryptography.RijndaelManaged Private iVector As Byte() Private Key As Byte() Public Function encrypt(ByVal data As String) ...

Receiving 'The input is not a complete block' error, tried everything I can find on google. Rjindael Encryption in .NET

Mornin', I'm trying to just get basic encryption working using System.Security.Cryptography.RjindaelManaged. I have google for this error and cannot find the problem, or what I am doing wrong. All I am attempting to do is encrypt a string, and then decrypt a string. Following is my code, and any help would be appreciated. Imports Syste...

RijndaelManaged "Padding is invalid and cannot be removed" that only occurs when decrypting in production

I know other questions have been asked on this but none so far have provided a solution or are exactly the issue I have. The class below handles the encryption and decryption of strings, the key and vector passed in are ALWAYS the same. The strings being encrypted and decrypted are always numbers, most work but the occasional one fails...

Java encode and .NET decode

The encryption is in java: String salt = "DC14DBE5F917C7D03C02CD5ADB88FA41"; String password = "25623F17-0027-3B82-BB4B-B7DD60DCDC9B"; char[] passwordChars = new char[password.length()]; password.getChars(0,password.length(), passwordChars, 0); SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1"); KeySpec spe...

RijndaelManaged: IV Generation?

I want to implement the most secure, and most reliable form of symmetric key cryptography in my application. The user should input a password to encrypt/decrypt, and that's all. For RijndaelManaged, one must enter a key and an IV. I'm not sure how to address the situation. Right now, I have the entered password being hashed by SHA256 ...

Encrypting Files with AES, Encrypting Key with RSA - Am I on the right track?

Overview: I'm trying to design an application that will encrypt files to safely send through Snail Mail (LARGE sets of data). I'm planning on using AES/RijndaelManaged encryption from .Net to encrypt the files initially, using a randomly generated key using RNGCryptoServiceProvider. I'm then encrypting this random AES key with a RSA Pu...

How do you save and retrieve a Key/IV pair securely?

I'm using VB.Net's RijndaelManaged (RM) to encrypt files, using the RM.GenerateKey and RM.GenerateIV methods to generate the Key and IV and encrypting the file using the CryptoStream class. I'm planning on saving this Key and IV to a file and want to make sure I'm doing it the right way. I am combining the IV+Key, and encrypting that w...

AesManaged and RijndaelManaged

Im currently developing a Silverlight application that connects to an old webservice. Our old webservice uses an encryption tool which silverlight does not support. Finally, we decided to used AesManaged for encryption, however, our webservice does not support AesManaged. Is their a way to decrypt an AesManaged to RijndaelManaged? If y...

Specified key is not a valid size for this algorithm...

Hi, I have with this code: RijndaelManaged rijndaelCipher = new RijndaelManaged(); // Set key and IV rijndaelCipher.Key = Convert.FromBase64String("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345678912"); rijndaelCipher.IV = Convert.FromBase64String("1234567890123456789012345678901234567...

AES / Rijndael Test Vectors : what padding mode?

So I've been looking at these test vectors for the Known Answer Test for AES / Rijndael (with 128-bit block) in CBC mode, and I wonder: what kind of padding do they use? PKCS7? ...