rijndaelmanaged

Rijndael managed: plaintext length detction

I am spending some time learning how to use the RijndaelManaged library in .NET, and developed the following function to test encrypting text with slight modifications from the MSDN library: Function encryptBytesToBytes_AES(ByVal plainText As Byte(), ByVal Key() As Byte, ByVal IV() As Byte) As Byte() ' Check arguments. I...

How can I decrypt a string using AES algorithm in c#?

Hi, I have an encrypted string from one of our customers. This string was encrypted using the AES method in Java. The only thing I have is the key: "xxxxxxxxxxxxxxxxxxxxxxxx" (24 chars) and the encrypted text: "56e84e9f6344826bcfa439cda09e5e96" (32 chars). (This really is the only data I have) I can't seem to find a method to decryp...

how to call RijndaelAlg.CreateEncryptor in C# correctly when saving lots of independent files

In my situation I have a number of files that will be stored on a server. Each of these files is created by a C# application that I am writing. background: For this application, the amount of time needed to encrypt isnt important, the files tend to be small and we've got plenty of CPU cycles to spare (the client is the only computer ...

how to check whether data is already encrypted or not

Hi, I am using RijndaelManaged in my current project to encrypt data , is there any way tht I can check whether the data is already encrypted or not so i don't end up encrypting it twice? ...

Using Rijndael encryption for large files

Hi there! I'm in a situation where I need to encrypt / decrypt a file of n length securely, ideally using Rijndael, but definitely at 256bit encryption. I've played around with encryption before and have encrypted/decrypted strings and byte arrays quite happily. However, because I don't know the size of the file (and it's very feasible...

Calculation of encrypted file size does not match true size.

I have the need to calculate the size of a file I am encrypting using Rijndael. According to other answers on this site, and on google, the following is the correct way of calculating encrypted data length: EL = UL + (BS - (UL Mod BS) Mod BS) Where: EL = Encrypted Length UL = Unencrypted Length BS = Block Size In my instance, the u...

Write Serialized XML to String and Display in Browser

I have a serialized object which needs to be sent as an encrypted XML string. I am able to save the serialized object to a well-formed XML file, but this is not what I want. I have already got Rijndael encrypt/decrypt working for a sample string. Person person = new Person("Irish", "Chieftain"); XmlSerializer xmlSerializer = new XmlSeri...

C# Private/Public Encryption using AES

I am trying to figure out how to make public/private keys that are AES encrypted. I'd like to be able to use it like so: byte[] BytesToEncrypt = { 0x01, 0x02, 0x03, 0x04, 0x05 }; byte[] PublicKey; byte[] PrivateKey; byte[] EncryptedBytes; byte[] UnencryptedBytes; PrivateKey = CreatePrivateKey(); PublicKey = CreatePublicKey(PrivateKey);...

How do I encrypt a string in vb.net using RijndaelManaged, and using PKCS5 padding?

I use the following code to initialize encryption... Dim symmetricKey As New System.Security.Cryptography.RijndaelManaged() With symmetricKey .Key = Encoding.ASCII.GetBytes(Key) .IV = Encoding.ASCII.GetBytes(IV) .Mode = CipherMode.CBC .BlockSize = 128 .KeySize = 128 .Padding = PaddingMode.PKCS7 End With The requi...