{"id":19341915,"url":"https://github.com/blewater/rsa","last_synced_at":"2025-12-15T18:10:34.644Z","repository":{"id":79801372,"uuid":"191614504","full_name":"blewater/rsa","owner":"blewater","description":"RSA exploration","archived":false,"fork":false,"pushed_at":"2019-07-01T00:57:44.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-24T08:46:03.337Z","etag":null,"topics":["go","golang","modulus","rsa"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blewater.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-12T17:17:08.000Z","updated_at":"2021-10-07T13:33:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"ca54eed9-fa5a-4331-aa8b-cfaa6db26ad5","html_url":"https://github.com/blewater/rsa","commit_stats":null,"previous_names":["nethatix/rsa"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/blewater/rsa","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blewater%2Frsa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blewater%2Frsa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blewater%2Frsa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blewater%2Frsa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blewater","download_url":"https://codeload.github.com/blewater/rsa/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blewater%2Frsa/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271578495,"owners_count":24784051,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","modulus","rsa"],"created_at":"2024-11-10T03:33:05.418Z","updated_at":"2025-12-15T18:10:34.313Z","avatar_url":"https://github.com/blewater.png","language":"Go","readme":"# RSA #\n\n## RSA is likely the most popular public key cryptographic set of algorithms. ##\n\nStep 1:\nChoose two secret large random primes `p, q`.\n\nStep 2:\nCompute `p*q = n.` n is disclosed as part of the public key.\n\nStep 3:\nCompute `Phi(n) = (p-1)*(q-1).` This is the totient function answering the number of co-prime numbers between 1...n.\n\nStep 4:\nChoose a number `e \u003c n` which is co-prime to Phi(n).\n\n`(n, e) is then the public key.`\n\nStep 5:\nFind the modular multiplicative inverse of e modulo Phi(n) `e` such that `e*d ≡ 1 (mod Phi(n)).`\n\n`(n, d) is then the private key.`\n\nStep 6:\nEncrypt a message `m` such that `cipher = m^e(mod n).`\n\nStep 7:\nDecrypt an encrypted message cipher such that `m = cipher^d(mod n).`\n\n#### Question 1: ####\nWhy is deriving the private d from (n, e) extremely challenging for large secret random p, q prime factors?\n\n#### Answer: ####\nWhile there has been progress in factoring at least one large n number up to 193 digits (RSA-640 bits,) cracking 1024-bit numbers or even as large as 2048-bit numbers appear to out of reach for the time being.\n\n#### Question 2: ####\nDoes that mean that RSA is uncrackable for large n (\u003e 2048 bits)?\n\n#### Answer 2: ####\nYes, if the chosen random p, q primes are truly random and truly primes which has not always been the case commercially.\n\n``` Note: there is a known exploit for cracking large keys by pairing same-sized n public RSA keys and calculating hcf on them to find any factors other than 1. If one is computed (poor p, q randomness) it is likely a prime factor of both n and the 2nd factor can then be computed instantly.```\n\n[Pollard's Rho](https://www.wikiwand.com/en/Pollard%27s_rho_algorithm) is a relatively efficient probabilistic algorithm for factoring small sized n. \n\nThe Rho algorithm is employed to reverse an encrypted RSA message in this repo.\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblewater%2Frsa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblewater%2Frsa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblewater%2Frsa/lists"}