开发者

Encrytion and Decryption without using a cipher instance or key [closed]

开发者 https://www.devze.com 2023-04-03 13:59 出处:网络
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post.
Closed. This question needs details or clarity. It is not currently accepting answers.

Want to improve this question? Add details and clarify the problem by editing this post.

Closed 9 years ago.

Improve this question

Does 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号