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

  • Home
  • SEARCH
  • 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 6357795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:14:22+00:00 2026-05-24T23:14:22+00:00

I am generating a random number of 32 bytes (which from Microchip PIC24F). When

  • 0

I am generating a random number of 32 bytes (which from Microchip PIC24F). When the Android devices receives the random 32 bytes from the PIC24F via the Android USB accessory framework, I would like to create a RSA key. Is it possible to create a public & private key through the random 32 byte?

32 bytes is relatively weak as I had some knowledge on how RSA works. Large RSA may require a lot of computing power! I am only running this on a Android mobile.

If possible I would want to know what the limitation of the computing power to calculate an secure RSA key (I do know that different phone manufacturer with different resource may vary). What is largest key I can generate with reasonable resource on the Android mobile (To the extend that the application I program will not crash/not respond/force close)

Tools Used:
Nexus One (Android 2.3.4)

  • 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-24T23:14:23+00:00Added an answer on May 24, 2026 at 11:14 pm

    I know very little about the Android API, but I can tell you how you would go about doing this. I doubt there is a way in the API to do this directly, but maybe this information will be enough for you to piece together what to do.

    In order to generate an RSA key, you need to generate two relatively large prime numbers. I would generate two numbers with no less than 768 bits apiece.

    The technique for generating these primes is to use a cryptographically secure pseudo-random number generator (PRNG) to generate 766 bit values. Basically, generate 96 bytes and throw away the upper 2 bits. Then you shift the value up by a bit, and set the lowest and highest bit so you have an odd number that’s >= 2**767 + 1 (and therefor requires 768 bits to represent). Then you feed the generated number into a probabilistic prime test. First you test for divisibility by the first few odd primes, so 3, 5, 7, 11, 13 and 17. Then you run a few iterations of Miller-Rabin.

    If the number passes these tests, you most likely have a prime number, if it doesn’t you start over and generate a new number.

    Generate two such prime numbers, and you have an RSA key.

    In order to generate these primes from 32 bytes of random data, you need to seed the PRNG with this data.

    Personally, I would recommend getting 128 bytes of random data. You seed the PRNG with the first 64 bytes, and then every time you call it, you add one more byte of your random data to the entropy pool of your PRNG. Any cryptographically secure PRNG will have a method for doing this.

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

Sidebar

Related Questions

Is there a difference between generating multiple numbers using a single random number generator
Possible Duplicate: generating random numbers from skewed normal distribution i expect a long array
Possible Duplicate: Java: generating random number in a range I want to generate a
Possible Duplicate: Generating Random Numbers in Objective-C How do I generate a random number
I'm generating a random number between min and max with this code: return min
Possible Duplicate: Java: generating random number in a range How do I generate a
I am looking for a pseudo random number generator which would be specialized to
How should i be generating a random number between 0 and up to 2?
I want it keeps generating different random number. How to use While statement? int
HI i'm stock with generating a random number I have an array that holds

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.