Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6785799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:10:14+00:00 2026-05-26T17:10:14+00:00

I’m doing a project where I need to either find or build an RSA

  • 0

I’m doing a project where I need to either find or build an RSA and an Elgamal algorithm, a triple DES algorithm, and a digital hashing signature algorithm.

I’m trying to put my code together, but I keep getting hung up on coding RSA and Elgamal. I was wondering if anyone had any useful links to RSA pseudocode: specifically, calculating large primes (aka p and q) [I can’t seem to get euler’s right], and finding a coprime to phi(n) = (p-1)(q-1) (aka e). The purpose of all of the equations I’m trying to code is to find large primes, efficiently. If anyone knows of an easier way to do this [calculating large primes efficiently], it would be greatly appreciated.

Additionally, I’m getting a little hung up on padding… I can scrape by with my project just doing a nonpadded encryption/decryption, but I want to kind of go above and beyond… any links to useful padding schemes/padding scheme pseudocode would be greatly helpful.

I tried searching on google for good pseudocode, but I’ve only really found kind of ambiguous pseudocode for the large prime calculation… (either that or I’m just really dense).

Any help would be greatly appreciated (and just to specify, I don’t need someone to write an entire algorithm for me, I just need a push in the right direction).

Thank you for your time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:10:15+00:00Added an answer on May 26, 2026 at 5:10 pm

    I'm trying to put my code together, but I keep getting hung up on coding RSA and Elgamal. I was wondering if anyone had any useful links to RSA pseudocode: specifically, calculating large primes (aka p and q) [I can't seem to get euler's right], and finding a coprime to phi(n) = (p-1)(q-1) (aka e)

    Generating large primes isn’t easy, since no proper way to calculate a prime is known (luckily, if there was one, RSA would be broken). What you normally do is take random numbers and perform a primality test like Miller-Rabine which preforms very well (50 executes narrows it down to a 1/2^50 percent chance that the tested number is a prime). The only requirement is that the random numbers have to be really really random, else the found key is not safe. Linux /dev/random is a good source to initiate a random generator. Or the preferred crypto module of a language (C: openssl, Java: SecureRandom…).

    There is no real pseudocode around RSA, since it is a mathematical process. The closest to pseudocode I could get was a python implementation For prime generation there is a neat python example on literate programs. Also here

    About padding, wikipedia explaines one padding scheme pretty well. Also this blog entry helped me a lot understanding padding.
    Links about padding:
    http://rdist.root.org/2009/10/06/why-rsa-encryption-padding-is-critical/
    http://www.symantec.com/connect/blogs/common-rsa-implementation-mistake-explained

    I hope this pushes you into the right direction.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I need to clean up various Word 'smart' characters in user input, including but
I have thousands of HTML files to process using Groovy/Java and I need to
I need a function that will clean a strings' special characters. I do NOT
I am trying to understand how to use SyndicationItem to display feed which is
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.