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 6811531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:20:22+00:00 2026-05-26T20:20:22+00:00

I’ve decided to learn about RSA encryption since learning about the vernal cipher in

  • 0

I’ve decided to learn about RSA encryption since learning about the vernal cipher in a comp sci lecture.
I grasp the idea behind RSA (it’s very clever), however while trying to write my own C program to encrypt and decrypt a string of characters I have run into a few problems.

I am encrypting each character’s ASCII value using the public key then decrypting the cipher text. However, I have found that sometimes the public key I have created will encrypt an ASCII value to 0, then there is no way to decrypt it as 0^anything = 0.
I surely must be wrong here as binary can be encrypted/decrypted using RSA.

E.g.

  • p = 3
  • q = 5
  • N = 15 (p*q)
  • m = (p-1)(q-1) = 8
  • e = 7 (coprime to m)
  • d = 7 (7d(mod8) = 1 … Before people have a go, I am only using 7 because it’s convenient for this example (not for a secure encryption)

Now take the char “T” (ASCII value 84)

Run the encryption, the cipher text is = 0

0^7 (mod 8) = 0 … not 84!

Can someone point me in the right direction please.

Thanks in advance

  • 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-26T20:20:23+00:00Added an answer on May 26, 2026 at 8:20 pm

    RSA encryption is limited to encrypting positive numbers in the range 1 to (p*q)-1, which are not multiples of p or q. In practical applications, p*q will generally be much bigger than the largest message to be encrypted, and messages will be padded with random bits to fill up the range 1 to (p*q)-1. While it’s theoretically possible that the random padding chosen for a message might cause it to be a multiple of p or q, in practice the only way that can happen is if there is something severely wrong with the random number generator.

    In “toy applications”, however, problematic values represent a much larger portion of the possible message space. Even if you chose p and q to be large enough that the p*q was larger than your message (e.g. 13 and 17) there would still be many possible message values that would fail (e.g. 65 or 85). I would suggest 13 and 17 as reasonable values to use for demonstration purposes, with the caveat that not all message values will work.

    • 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
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I used javascript for loading a picture on my website depending on which small
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
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has

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.