I'm looking for a solution for encrypting and decrypting data using C#.
The data must
be encrypted/decrypted with a key. Itshould not be a
longbyte array. The encrypted result must looks like a Guid (e.g.
b72834bb-f93d-4c6b-b659-122875388b1f).
Are there best practices, already created classes etc.?
Member
6 Points
19 Posts
How to encrypt en decrypt data with C#?
Dec 12, 2013 04:11 AM|Jordy88|LINK
Hi everyone,
I'm looking for a solution for encrypting and decrypting data using C#.
The data must be encrypted/decrypted with a key. It should not be a long byte array. The encrypted result must looks like a Guid (e.g. b72834bb-f93d-4c6b-b659-122875388b1f).
Are there best practices, already created classes etc.?
Thanks a lot!
Jordy
Star
13653 Points
5480 Posts
Re: How to encrypt en decrypt data with C#?
Dec 12, 2013 04:22 AM|Ashim Chatterjee|LINK
check this :
http://www.codeproject.com/Tips/635973/Encrypt-and-Decrypt-data
Member
6 Points
19 Posts
Re: How to encrypt en decrypt data with C#?
Dec 12, 2013 04:48 AM|Jordy88|LINK
Thanks. The result of the encryption must in a url. So I don't characters like \ > / etc. etc.
Star
13653 Points
5480 Posts
Re: How to encrypt en decrypt data with C#?
Dec 12, 2013 04:51 AM|Ashim Chatterjee|LINK
use string.replace to remove the characters you dont want.
Member
6 Points
19 Posts
Re: How to encrypt en decrypt data with C#?
Dec 12, 2013 05:13 AM|Jordy88|LINK
That's not possible, because i need to decode the string after encryption.
Member
63 Points
90 Posts
Re: How to encrypt en decrypt data with C#?
Dec 17, 2013 07:12 PM|niravpatel|LINK
Why don't you convert the encrypted string to hex (which will be longer but still url safe) and then on the other do the reverse?
BitConverter.ToString(YOUR_BYTE[]_CONTAINING_ENCRYPTED_DATA);