Hello everybody and sorry for my hard english. I know how work rsa and all is simply for understand, but i dont understand how implement block division. some example supposably we have alphabet where a-10,b-11...z-35. we presented our message "abcdefg" like "10111213141516", split this into blocks(for example in trhees "101""112"...for n=352),crypt this blocks and get crypted text. but what if after crypt (c = (m^e)mod n)we get some blocks with two numbers? and when we try decrypted text and split into blocks, we get other blocks maybe... in fine, sorry for my muddled thoughts and bad language and tell me what is true way in java for splitting text, what the length for blocks need...

有帮助吗?

解决方案

Why implement if there is allready JCA APIs?
http://docs.oracle.com/javase/7/docs/technotes/guides/security/crypto/CryptoSpec.html
It covers Java Security standards, has plenty of implemented algorithms.

See also some examples:
http://www.flexiprovider.de/examples/ExampleRSA.html
Single Asymmetric Key
RSA java example Encryption / Decryption

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top