Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Joe Ess

problem in XOR of private key using public key....  RSS feed

Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my application , i am generating public key and private key using RSA algo and using 1024 bytes.
and i am storing that keys in file.
that is completed fine..

now, my requirement is that i have to store private key in some secure way.

so, now have encrypt that private, i have to XOR private key using public key..
i.e. privatekey ^ publickey
and after that i have to store public key and encrypted private key in file..

so, when i encrypt file, i am using public key.
and for decryption i use that private key..
but before using private key, i have to XOR that using public key.
so, i again get orignal priavate key....

so, who i can do this ?
i try hard but there is problem that i get bytes from private key it is ok, but how i can get again private key from bytes.
and size of both public key and private key byte is not same, so problem in XOR process.

pls, help me..?

is there any wany so i can store my private key in some secure way ?
Posts: 23566
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, technically you are not encrypting the private key, you are just obfuscating it. So... if obfuscating is acceptable then how about encrypting the private key with the private key? After all, you have the public key so you can decrypt it.


[NOTE: I always thought that keys of a asymetric pair are the same size]
[ September 21, 2006: Message edited by: Henry Wong ]
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!