• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Have a problem when encrypt by RSA

 
ba thong
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a method

I write a class test this method

when I execute the minutes each are different results for each
help me please, thanks a lot of
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does "ReadPublicKey("publicReceiver.k")" return the same result each time it is called? If not, then all bets are off.

Note that encrypted stuff is binary data, not text - so an operation like "new String(encrypted stuff)" does not make sense, and will lead to unexpected results.

What do you mean by "when I execute the minutes" - are you running this code several times within a few minutes, or what?
 
ba thong
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:Does "ReadPublicKey("publicReceiver.k")" return the same result each time it is called? If not, then all bets are off.

Ok it here



Note that encrypted stuff is binary data, not text - so an operation like "new String(encrypted stuff)" does not make sense, and will lead to unexpected results.


I have two method so that show result encrypt and decrypt format String

I continue test, when i write

The result is data1 unlike data2 !! Why ??? hixhix.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic