开发者

from Plain text generate encrypted text of same legnth [closed]

开发者 https://www.devze.com 2023-04-07 06:57 出处:网络
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this po
Closed. This question needs to be more focused. It is not currently accepting answers.

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

开发者_运维百科

Closed 7 years ago.

Improve this question

I want to create a java program in which I will give plain text , a key then the output should be of same length as of plain text. Using the same key I will decrypt the encrypted text. So please suggest me how to proceed?

Thanks.


What sort of encryption scheme are you wanting? The Vigenère cipher will give you ciphertext of the same length as your plaintext, but if the key is not random the ciphertext will be vulnerable to various frequency attacks such as the Kasiski examination.

What are you trying to achieve?


Using a stream cipher like RC4 or a block cipher like AES in a counter mode can do what you want. However, these still require an a random IV for each message so you have to somehow manage that.

0

精彩评论

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

关注公众号