• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Have a problem when encrypt by RSA

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic