Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this questionDoes any one know how to encrypt and decrypt a string without using a key or cipher, A simple encryption which takes input as string and then when i want i call decrypt function to decrypt it where开发者_运维技巧 input is as encrypted string.
If your crypto doesn't use a key, a random pad, or a secret of some sort then it can only be secure if the algorithm is secret and unguessable. When you rely on the algorithm staying secret, you're relying on security by obscurity which has a really poor track record.
I know key-exchange can be a PITA, but it's the only way to prevent eavesdropping by any semi-competent attacker.
Try ROT13, it is as secure as this will get. No real encryption though.
You can embed your encryption/decryption key in your application and you won't have anything to do with it. But your encryption will be as secure as you store it - not really secure. And anyone can disassemble the application and call your decrypt routine.
That's hardly encryption - as soon as an attacker can call the "decrypt" function, your secret is gone. You could use a standard encryption algorithm, and call it with a key built-in in the code - but I do not recommend it. Especially since the key in the code would be visible to anyone who can access your code, compiled or not.
精彩评论