{"id":21434363,"url":"https://github.com/z1skgr/rsa-crypto","last_synced_at":"2026-01-27T07:04:23.627Z","repository":{"id":163130795,"uuid":"469092583","full_name":"z1skgr/rsa-crypto","owner":"z1skgr","description":"Cryptographic algorithm using openssl","archived":false,"fork":false,"pushed_at":"2024-11-27T12:16:07.000Z","size":576,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T18:12:24.171Z","etag":null,"topics":["bignum","cryptography","encryption-decryption","hash","openssl","public-key","rsa"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/z1skgr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-03-12T13:37:06.000Z","updated_at":"2024-12-19T09:16:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"25c9e8e2-b2e5-4590-802c-f27d06e2997b","html_url":"https://github.com/z1skgr/rsa-crypto","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/z1skgr/rsa-crypto","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z1skgr%2Frsa-crypto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z1skgr%2Frsa-crypto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z1skgr%2Frsa-crypto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z1skgr%2Frsa-crypto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/z1skgr","download_url":"https://codeload.github.com/z1skgr/rsa-crypto/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z1skgr%2Frsa-crypto/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28807121,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T06:25:51.065Z","status":"ssl_error","status_checked_at":"2026-01-27T06:25:50.640Z","response_time":168,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bignum","cryptography","encryption-decryption","hash","openssl","public-key","rsa"],"created_at":"2024-11-22T23:34:57.737Z","updated_at":"2026-01-27T07:04:23.614Z","avatar_url":"https://github.com/z1skgr.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rsa/crypto \n \u003e Cryptographic algorithm using public key cryptosystem :tada:\n \n\n## Table of contents\n* [General Info](#general-information)\n* [Setup](#setup)\n* [How to run](#how-to-run)\n* [Acknowledgements](#acknowledgments)\n\n## General Information\n__RSA__ is an asymmetric cryptographic algorithm where each user has two keys\n* private \n* public\n\nIt uses data from the theory of numbers and in combination with the particularly large keys achieves encryption in \na balance arithmetic that makes decryption by factorization impossible.\n\n### bn_act_1 \u0026 2.c\n1. Create a private key[^4]\n2. Message encryption\n\n|   | Description |\n| ------------- | ------------- |\n| p  | Prime  |\n| q  | Prime  |\n| e  | number |\n| n  |  p * q |\n| e,n  |  Public key |\n| d |  Private key |\n    \nCalculations\n\n$public_{key} = (e,n)$\n\n$p = 953AAB9B3F23ED593FBDC690CA10E703$\n\n$q = C34EFC7C4C2369164E953553CDF94945$\n\n$e = 0D88C3$\n\n$n = p * q$\n\n$M = \"message\"$\n\n#### Act \n* Calculate private key d\n* Name surname encryption\n\n\n\n### bn_act_3 \u0026 4_1.c\n1. Message decryption\n2. Message signing\n\nCalculations\n\n$d = 74D806F9F3A62BAE331FFE3F0A68AFE35B3D2E4794148AACBC26AA381CD7D30D$\n\n$e = 010001 (this hex value equals to decimal 65537) $\n\n$n = DCBFFE3E51F62E09CE7032E2677A78946A849DC4CDDE3A4D0CB81629242FB1A5$\n\n$M = \"message\"$\n\n$M` = \"messag\"$\n\n#### Act \n* Decrypt message using private and public key\n* Message signing to two different texts\n\n### bn_act_4-2.c\n1. Signature Verification\n\nCalculations\n\n$public_{key} (e,n)$\n\n$S = 643D6F34902D9C7EC90CB0B2BCA36C47FA37165C0005CAB026C0542CBDB6802F$\n\n$e = 010001 (this hex value equals to decimal 65537) $\n\n$n = AE1CD4DC432798D933779FBD46C6E1247F0CF1233595113AA51B450F18116115$\n\n$M = \"Launch a missile\"$\n\n#### Act \n* Signing verification\n* Signing verification with modified S (last bit 2F-\u003e3F)\n\n\n## Setup\nLarge numbers **bn[^1]** (multiprecision integer arithmetics) library provided by the **openssl [^2]**\nFor more information, you can check [bn](https://www.openssl.org/docs/man1.0.2/man3/bn.html).\n\n\u003cbr\u003e\u003cbr\u003e\nCheck the virtual Ubuntu SEED machine 16.04.\n\n\n1. Download SEEDUbuntu-v 16.04 from site\n```\nhttps://seedsecuritylabs.org/lab_env.html\n```\n2. Download and install VM engine from site\n```\nhttps://www.virtualbox.org/wiki/Downloads\n```\n3. Build a new VM os importing SEEDUbuntu \n   * Select OS Type Linux [^3] version Ubuntu\n\n4. PRE-build VM hard disk from SEED file\n  * From the unzipped folder, select ```xxxx.vmdk``` where xxx is the SEED_name_version\n\n5. Setting-\u003eGeneral-\u003eAdvanced \n   - [x] Shared Clipboard : Bidirectional\n   - [x] Drag'n'Drop : Bidirectional\n   - [x] Controller : VBoxVGA\n   - [x] Processor : 1+ \n\n6. Open terminal\n```\n$ sudo apt update\n$ sudo apt install build-essential checkinstall zlib1g-dev -y\n$ cd /usr/local/src/\n$ wget https://www.openssl.org/source/openssl-1.0.2o.tar.gz\n$ tar -xf openssl-1.0.2o.tar.gz\n$ cd openssl-1.0.2o\n$ ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib\n$ make\n$ make test\n$ make install\n```\n\n7. Configure libraries\n```\n$ cd /etc/ld.so.conf.d/\n$ vim openssl-1.0.2o.conf\n```\n8. Paste\n```\n$ /usr/local/ssl/lib\n```\n9. Reload link\n```\n$ sudo ldconfig -v\n```\nYou can edit with atom or any other editor\nOpenSSL is installed in the `'/usr/local/ssl'` directory.\n\n\n\n## How to run\nAny `.c` file can be executed as\n```\ngcc XXXXX -o XXXXXX.c -lcrypto\n```\n\nwhere `XXXXX` filename\n\n\n\n\n## Acknowledgments\n* Assignment for cryptography\n\n[^1]: BIGNUM can represent every great number, see https://www.openssl.org/docs/man1.0.2/man3/bn.html\n[^2]: https://www.openssl.org\n[^3]: Make sure install version ubuntu x32 architecture compatible with SEEDUbuntu.\n[^4]: For simplicity, we use numbers 128 bits. Must be 512.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fz1skgr%2Frsa-crypto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fz1skgr%2Frsa-crypto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fz1skgr%2Frsa-crypto/lists"}