rijndaelmanaged

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

随声附和 提交于 2019-12-01 05:26:12
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 decrypt this string. Could anyone provide me with a working example. Filip Ekberg Here are two complete code samples for you: How To: Encrypt and Decrypt Data Using a Symmetric (Rijndael) Key How To: Encrypt Data With Salt (C#/VB.NET) You might also find c# implementations of

Is this a reasonable way to implement 'remember me' functionality

北慕城南 提交于 2019-11-30 14:03:16
问题 If a user logs into the site, and says 'remember me', we get the unique identifier for the user, encrypt this with RijndaelManaged with a keysize of 256 and place this in a httponly cookie with a set expiration of say.. 120 days, the expiration is refreshed each successful request to the server. Optionally we generate the initialization vector based upon the user agent and part of the ipv4 address (the last two octets). Obviously theres no real expiration system built into this, the user

How to use Rijndael encryption with a .Net Core class library? (Not .Net Framework)

牧云@^-^@ 提交于 2019-11-30 13:13:08
问题 How do we use Rijndael encryption in a .Net Core class library? (Not a .Net Framework Class Library) We need to create a shared .Net Core library for use in multiple projects and need to implement Encrypt and Decrypt methods that use the same Rijndael encryption across the projects. We are currently using: VS Enterprise 2015 c# .Net Core Class Library .NETStandard, Version=v1.6 reference It appears that the implementation of Rijndael and AES is missing from the .Net Core 1.0 release...it

Is this a reasonable way to implement 'remember me' functionality

主宰稳场 提交于 2019-11-30 09:24:19
If a user logs into the site, and says 'remember me', we get the unique identifier for the user, encrypt this with RijndaelManaged with a keysize of 256 and place this in a httponly cookie with a set expiration of say.. 120 days, the expiration is refreshed each successful request to the server. Optionally we generate the initialization vector based upon the user agent and part of the ipv4 address (the last two octets). Obviously theres no real expiration system built into this, the user could technically use this encrypted key forever (given we don't change the server side key).. I considered

Reading from a cryptostream to the end of the stream

孤人 提交于 2019-11-30 07:36:06
问题 I'm having some trouble with the code below. I have a file in a temporary location which is in need of encryption, this function encrypts that data which is then stored at the "pathToSave" location. On inspection is does not seem to be handling the whole file properly - There are bits missing from my output and I suspect it has something to do with the while loop not running through the whole stream. As an aside, if I try and call CryptStrm.Close() after the while loop I receive an exception.

How to use Rijndael encryption with a .Net Core class library? (Not .Net Framework)

我们两清 提交于 2019-11-30 06:49:10
How do we use Rijndael encryption in a .Net Core class library? (Not a .Net Framework Class Library) We need to create a shared .Net Core library for use in multiple projects and need to implement Encrypt and Decrypt methods that use the same Rijndael encryption across the projects. We are currently using: VS Enterprise 2015 c# .Net Core Class Library .NETStandard, Version=v1.6 reference It appears that the implementation of Rijndael and AES is missing from the .Net Core 1.0 release...it seems to only include the base classes. How do we get a .Net Core implementation of Rijndael or AES

Specified initialization vector (IV) does not match the block size for this algorithm

故事扮演 提交于 2019-11-30 04:31:49
I am working on a base encryption method. I am using RijndaelManaged. I got this code from somewhere a long time ago, but can't remember where. I had my code working before, but something changed and I cannot quite figure it out. When I run my code, I get the following error; Specified initialization vector (IV) does not match the block size for this algorithm. Here is my code: string textToEncrypt = "TEST STRING"; int keySize = 256; string hashAlgorithm = "SHA1"; string passPhrase = "AH!PSB0%FGHR$"; string saltValue = "LRT%YUR#VBNL@1"; string initVector = "HR$2pIjHR$2pIj"; byte[]

simple encrypting / decrypting in VB.Net

随声附和 提交于 2019-11-30 04:06:31
I'm trying to figure out how to encrypt / decrypt a string in VB.Net. I followed the example given here and wrote the following code (below). There's a text box, an "encrypt" button, and a "decrypt" button. The idea is to type something into the text box ("like 'hello world'"), click "encrypt", and see the encrypted version appear in the text box. Clicking "decrypt" should then take you back to the original string. But when I try to encrypt I get an error when I try to "FlushFinalBlock". The error is: "Length of the data to encrypt is invalid". The "decrypt" part is a total shot in the dark,

Difference between symmetric crypto algorithms [closed]

落爺英雄遲暮 提交于 2019-11-30 03:36:07
C# looks to have 4 different symmetric crypto algorithms: RijndaelManaged, DESCryptoServiceProvider, RC2CryptoServiceProvider, and TripleDESCryptoServiceProvider. I am looking for more information between them. Mainly what is the differences between each of them. MSDN isn't being much help, or I am just tired. ;) I am sure there is pro and cons between each of them, just like anything where there are multiple ways of doing something. Thank you for any enlightenment. Tony Hamish Smith This the Ranking (for year 2015) the strongest algorithm appears on top: Rijndael (more commonly referred to as

Reading from a cryptostream to the end of the stream

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-29 05:06:24
I'm having some trouble with the code below. I have a file in a temporary location which is in need of encryption, this function encrypts that data which is then stored at the "pathToSave" location. On inspection is does not seem to be handling the whole file properly - There are bits missing from my output and I suspect it has something to do with the while loop not running through the whole stream. As an aside, if I try and call CryptStrm.Close() after the while loop I receive an exception. This means that if I attempt to decrypt the file, I get a file already in use error! Tried all the