{"id":20023962,"url":"https://github.com/thebojda/simplersalibrary","last_synced_at":"2025-03-02T04:18:37.376Z","repository":{"id":31747202,"uuid":"35313288","full_name":"TheBojda/simplersalibrary","owner":"TheBojda","description":"Automatically exported from code.google.com/p/simplersalibrary","archived":false,"fork":false,"pushed_at":"2015-05-09T13:45:03.000Z","size":1608,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-12T16:43:05.861Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/TheBojda.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":"2015-05-09T03:24:30.000Z","updated_at":"2015-05-09T03:31:09.000Z","dependencies_parsed_at":"2022-08-29T16:00:53.841Z","dependency_job_id":null,"html_url":"https://github.com/TheBojda/simplersalibrary","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheBojda%2Fsimplersalibrary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheBojda%2Fsimplersalibrary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheBojda%2Fsimplersalibrary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheBojda%2Fsimplersalibrary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheBojda","download_url":"https://codeload.github.com/TheBojda/simplersalibrary/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241455592,"owners_count":19965637,"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":[],"created_at":"2024-11-13T08:48:47.912Z","updated_at":"2025-03-02T04:18:37.345Z","avatar_url":"https://github.com/TheBojda.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Simple RSA Library is a minimalistic OpenSSL compatible RSA library for Java and PHP. It supports key file generation, encryption/decryption, sign/verify documents.\n\nLook at the code examples for usage.\n\nGenerating PEM key files in Java (not implemented in PHP):\n\n```java\nRSATool tool = RSAToolFactory.getRSATool();\ntool.generateKeyPair(new File(\"public.pem\"), new File(\"private.pem\"));\n```\n\nEncrypt/decrypt data in Java:\n\n```java\nRSATool tool = RSAToolFactory.getRSATool();\n\nRSAKey publicKey = tool.loadPublicKey(new File(\"public.pem\"));\nRSAKey privateKey = tool.loadPrivateKey(new File(\"private.pem\"));\n\t\t\nbyte[] encoded = tool.encryptWithKey(input, privateKey);\nSystem.out.println(\"Encoded string: \" + new String(encoded));\n\t\t\nbyte[] decoded = tool.decryptWithKey(encoded, publicKey);\nSystem.out.println(\"Decoded string: \" + new String(decoded));\n```\n\nAnd the same in PHP:\n\n```php\n$rsa_tool = RSAToolFactory::getRSATool();\n\t\n$publicKey = $rsa_tool-\u003eloadPublicKey('public.pem');\n$privateKey = $rsa_tool-\u003eloadPrivateKey('private.pem');\n\t\n$encoded = $rsa_tool-\u003eencryptWithKey('Hello World!', $publicKey);\necho \"encoded: $encoded\u003cbr/\u003e\";\n\t\n$decoded = $rsa_tool-\u003edecryptWithKey($encoded, $privateKey);\necho \"decoded: $decoded\u003cbr/\u003e\";\n```\n\nSign/verify in Java:\n\n```java\nRSATool tool = RSAToolFactory.getRSATool();\n\nRSAKey publicKey = tool.loadPublicKey(new File(\"public.pem\"));\nRSAKey privateKey = tool.loadPrivateKey(new File(\"private.pem\"));\n\nbyte[] signature = tool.signWithKey(input, privateKey);\nSystem.out.println(tool.verifyWithKey(input, signature, publicKey));\n```\n\nAnd the same in PHP:\n\n```php\n$rsa_tool = RSAToolFactory::getRSATool();\n\t\n$publicKey = $rsa_tool-\u003eloadPublicKey('public.pem');\n$privateKey = $rsa_tool-\u003eloadPrivateKey('private.pem');\n\n$signature = $rsa_tool-\u003esignWithKey('Hello World!', $privateKey);\necho \"signature: $signature\u003cbr/\u003e\";\n\t\necho \"verify: \" . $rsa_tool-\u003everifyWithKey('Hello World!', $signature, $publicKey);\n```\n\nThis library uses [Bouncy Castle](http://www.bouncycastle.org/) library for the Java implementation.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthebojda%2Fsimplersalibrary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthebojda%2Fsimplersalibrary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthebojda%2Fsimplersalibrary/lists"}