• 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

Encryption example / tutorial....

 
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a programming assignment that is supposed to simulate RSA encryption with public / private keys. Unfortunatetly, I cannot use any of the standard security packages / classes that are available, but I have to create it from scratch.

Any suggestions?

Thanks in advance!
 
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Unfortunatetly, I cannot use any of the standard security packages / classes that are available, but I have to create it from scratch



Erm, are you telling us that you are not allowed to use JCE to perform this task. In effect you have to a) Implement your own JCE-alike layaer, and b) implement a pure java version of the RSA algorithm so that you can encrypt using public and private keys?

Using the "Standard way"



But, I imagine you knew that already.
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Sam Smoot:
I have a programming assignment that is supposed to simulate RSA encryption with public / private keys. Unfortunatetly, I cannot use any of the standard security packages / classes that are available, but I have to create it from scratch.

Any suggestions?

Thanks in advance!



If you really want to do it... I suggest reading "Applied Cryptography" by Bruce Schneier. I read it about 10 years ago, because I did not believe the mathematics behind public / private keys...

It is really hairy. I had to read it 3 or 4 times before I really understood it.

Henry
 
Sam Smoot
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is for an algorithms class. Yes, we have to create the Crypto ourselves.. And, as usual, a short time in which to do this..

Ah, the wonders of higher education... Should have taken the Greeter job at WalMart..
 
Ranch Hand
Posts: 125
1
Clojure Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does your assignment have constraints on the key size? If not, pick your two "big" prime numbers to be something like 37 and 41, and write the program that way. The math itself isn't that complicated. Otherwise, you'll need to use some library that handles numbers with hundreds of digits.

This page http://www.codeproject.com/dotnet/RSACryptoPad.asp has a decent overview. You should be able to figure out the code from there.

If you get stuck let us know - although I probably won't be able to help for a while, I'm going on vacation later this week. Good luck!
 
Michael Swierczek
Ranch Hand
Posts: 125
1
Clojure Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Son of a gun, I did not realize your last post was in September. Sorry to waste your time. Did you finish the assignment?
 
It's a tiny ad only because the water is so cold.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic