Click here to Skip to main content
15,897,147 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a project about cryptography.
I want to create a program by C# to embed a secret key into ciphertext, suppose, i had encrypted message to ciphertext c by algorithm Encryption as DES with key k, now i want to insert key k into ciphertext c, my problem: i don't know what algorithm or technical to do it, a algorithm random insertion or a logic technical, and my purpose is middle-man(actacker) can't understand key in ciphertext which contained key, and of course program allows get key from keyed ciphertext.
i have searched by google, but i don't find solution.
help me, nhoc_mientay@yahoo.com
Posted

If you intend to somehow combine the key with the ciphertext and the program to extract the key is provided, any resourceful attacker can extract the key without much trouble.

You may want to try asymmetric encryption instead.
 
Share this answer
 
I haven't tried Encryption programmatically much, but looking at your problem, i think encoding the key into the ciphertext may not be a good idea. Instead, I would suggest scrambling i.e. encrypting the key separately using one of the algorithms and then at the recieving end decode it to unlock the ciphertext.

Cheers
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900