Program to find decryption key in RSA algorithm

Discussion in 'MATLAB' started by David Davidson, Jan 17, 2011.

  1. Hi, I'm a bit of a beginner when it comes to using MATLAB. I was wondering if anyone knew of any codes to help me with the following questions:

    'In the RSA system, an individual follows this recipe. Choose two large primes p and q and compute n = pq. Then choose a number e < n which is coprime to ϕ(n) = (p−1)(q−1). Then find a number d such that ed ≡ 1 (mod ϕ(n)). The public key is the pair (n, e) and the private key is d. A message m sent to this person would be encrypted as c = m^e (mod n). The individual for whom the message was intended would decrypt c as m = c^d (mod n).

    1) Write a program to compute the private decryption key from a given public encryption key.
    2) Write a program to convert an encrypted number c = m^e (mod n) into the original m = c^d (mod n), where 0 ≤ m < n is some integer. State, with justification, the greatest number of digits that n can have for which your program can be trusted to work.'

    Any help would be much appreciated!
    David Davidson, Jan 17, 2011
    1. Advertisements

  2. David Davidson

    Steven_Lord Guest

    This sounds like a homework question. In general this newsgroup requires
    people posting homework questions (or questions that sound like they're
    homework, even if they're not) to show what they've done to try to solve the
    problem and to ask a SPECIFIC question before the readers will offer any
    suggestions. Post the code you've written to try to solve those questions
    and indicate where EXACTLY you're stuck and someone may offer some

    Steve Lord

    comp.soft-sys.matlab (CSSM) FAQ:
    To contact Technical Support use the Contact Us link on
    Steven_Lord, Jan 17, 2011
    1. Advertisements

  3. David Davidson

    Michael Chan Guest

    Michael Chan, Sep 12, 2011
  4. David Davidson

    Michael Chan Guest

    Michael Chan, Sep 12, 2011
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.