Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Encryption algorithms that don't use a key

Tags:

c#

encryption

I need a simple encryption algorithm that doesn't use a key.

Which ones do you guys recommend?

How about if I use the built in encryption method that forms authentication has? (I forget the method/namespace for it).

like image 849
Blankman Avatar asked Nov 27 '22 23:11

Blankman


2 Answers

Every symmetrical encryption scheme has a key. If you're looking for an encryption scheme where you don't manage the key, you might look into the Data Protection API, exposed in .NET (2.0 and above) as the System.Security.Cryptography.ProtectedData class. It provides symmetric encryption of arbitrary data, using the credentials of the machine or (better) the user, as the encryption key.

byte[] plaintextBytes = GetDataToProtect();
byte[] encodedBytes = ProtectedData.Protect(plaintextBytes
                                            , null
                                            , DataProtectionScope.CurrentUser);

See my other answer here for more detail.

like image 148
Michael Petrotta Avatar answered Nov 29 '22 13:11

Michael Petrotta


Something outside of the thing being encrypted needs to be used to do encryption, if only because you need that thing to decrypt it later. This external thing is a key. There is no useful encryption without a key. There is only hashing.

like image 42
Welbog Avatar answered Nov 29 '22 13:11

Welbog