Quantcast
Channel: Encrypting an encrypted string
Viewing all articles
Browse latest Browse all 2

Encrypting an encrypted string

$
0
0

Noob here with encryption! I am using

TripleDESCryptoServiceProvider class



I have a need for an application which will take user name, password and a profile id (which will act as the key). Encrypt both of them.
Now, I want to take the key (profile id) and persist it with its encrypted user name and password, and persist as a group to disk.

So, in other words, there could be several user name, password with profile id's but only a single file that only the application will have access to.

So, ive figured out I can encrypt all of that (including the encrypted data) but I am not 100% certain if it will backfire on me.

Can an encrypted string be encrypted again so that once it is decrypted it can be further decrypted successfully, bearing in mind the keys are used?

Example should clear it up:

1. Get username and password and have user provide a profile name.
2. Using the profile name as key, encrypt the User and password together. The end result is an encrypted string and its key (the profile name)
3. Repeat this process several times storing the profile names with their associated encrypted string.
4. When the users are done, and the application closes, persist the settings to a file that will be encrypted using the GUID of the application.

The end result is an encrypted file containing encrypted profile names with their associated encrypted username, password combo's, encrypted.

Will decryption work properly to restore the values to their correctly encrypted state?

Thanks


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images