{"id":21421988,"url":"https://github.com/c272/sharprsa","last_synced_at":"2025-08-16T11:39:23.255Z","repository":{"id":38442528,"uuid":"166801970","full_name":"c272/SharpRSA","owner":"c272","description":"An RSA implementation in pure C#, using the BigInt class.","archived":false,"fork":false,"pushed_at":"2022-08-08T14:57:43.000Z","size":49,"stargazers_count":6,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-03-06T08:06:57.129Z","etag":null,"topics":["bigint","csharp","encryption","rsa","rsa-cryptography"],"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/c272.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}},"created_at":"2019-01-21T11:22:20.000Z","updated_at":"2022-10-13T09:03:49.000Z","dependencies_parsed_at":"2022-08-19T15:50:26.937Z","dependency_job_id":null,"html_url":"https://github.com/c272/SharpRSA","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c272%2FSharpRSA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c272%2FSharpRSA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c272%2FSharpRSA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c272%2FSharpRSA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/c272","download_url":"https://codeload.github.com/c272/SharpRSA/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225964800,"owners_count":17552411,"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","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":["bigint","csharp","encryption","rsa","rsa-cryptography"],"created_at":"2024-11-22T20:41:13.156Z","updated_at":"2024-11-22T20:41:14.288Z","avatar_url":"https://github.com/c272.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SharpRSA\n*An RSA implementation in pure C#, using the BigInt class.*\n\n## Setup\nTo import SharpRSA, simply open the solution in VS2017 or above, and build. After this is done, add a reference to the generated class library and use the following to import:\n\n```\nusing System;\nusing SharpRSA;\n```\n\n## Usage\nThe bindings of the class library are very simple, and are easy to understand. Below is an example of a few various use cases.\n\n**Encrypt an Array of Bytes**\n```\n//The one parameter in this function is the bit length of the keys, which must be divisible by 8.\nKeypair kp = RSA.GenerateKeyPair(1024);\n\nbyte[] raw = { 0x00, 0x01, 0x02, 0x03, 0x04 ... }\n\n//These bytes are now encrypted using RSA, of the bitlength specified before.\nbyte[] encrypted = RSA.EncryptBytes(raw, kp.public_);\nbyte[] decrypted = RSA.DecryptBytes(encrypted, kp.private_);\n```\n\n**Encrypt a Class Instance**\n```\nKeypair kp = RSA.GenerateKeyPair(1024);\nExampleClass example = new ExampleClass(1, 2, 3, 4 ...);\n\n//The class instance is now encrypted with RSA.\nLockedBytes encrypted = RSA.EncryptClass(example, kp.public_);\nExampleClass decrypted = RSA.DecryptClass(encrypted, kp.private_);\n```\n\n## Networking\nYou can send public keys and LockedBytes over WCF (Windows Communication Foundation) or other networked means, as it is set up as a DataContract object.\n\nPrivate keys *cannot* be passed over, as they are set to private, readonly and are not part of the DataContract specified. This is to prevent incorrect asymmetric key usage.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc272%2Fsharprsa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fc272%2Fsharprsa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc272%2Fsharprsa/lists"}