{"id":21586739,"url":"https://github.com/behringer24/stringcrypt","last_synced_at":"2025-07-13T08:07:59.693Z","repository":{"id":28279095,"uuid":"31789643","full_name":"behringer24/StringCrypt","owner":"behringer24","description":"Simple Public Key (RSA) String encryption and signing for Android","archived":false,"fork":false,"pushed_at":"2020-10-16T15:57:32.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-24T15:41:51.805Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/behringer24.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-06T21:24:08.000Z","updated_at":"2020-10-16T15:57:35.000Z","dependencies_parsed_at":"2022-08-24T14:46:00.324Z","dependency_job_id":null,"html_url":"https://github.com/behringer24/StringCrypt","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behringer24%2FStringCrypt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behringer24%2FStringCrypt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behringer24%2FStringCrypt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behringer24%2FStringCrypt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/behringer24","download_url":"https://codeload.github.com/behringer24/StringCrypt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244189826,"owners_count":20412991,"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-24T15:14:32.347Z","updated_at":"2025-03-18T09:17:08.871Z","avatar_url":"https://github.com/behringer24.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# StringCrypt\n## Simple (long) String encryption and signing for Android/Java using public keys\n\nAllows to encrypt long Strings with RSA public key algorithm. RSA cipher is limited to a specific\nlength in JAVA/Android. The String is encryped by symmetric DESede algorithm and only the symmetric\nsession key is encrypted by RSA. The encrypted message and the symmetric key are packaged and can\nbe exported as base64 encoded string or byte array.\n\nThe recipient can then decrypt the symmetric key with his private key and use the symmetric key to\ndecrypt the message.\n\nSigning is using a sha1 footprint of the message and signs it with the private key. The receiving\nparty can use the senders public key to verify the validity of the signature.\n\n## Usage\n### Encrypting and decrypting Strings\n```java\n// Init object\nStringCrypt crypt = new StringCrypt();\n\n// generate key pair for demonstration (or each party reads either from storage)\nKeyPair kp = StringKeyTools.createKeyPair();\nKey privateKey = kp.getPrivate();\nKey publicKey = kp.getPublic();\n\n// encrypt String message to CryptPackage and/or encode package as String\nCryptPackage cryptPackage = crypt.encrypt(message, publicKey);\nString packageString = cryptPackage.toString();\n\n// ~~~ Do something with packageString, eg transmit over network\n\n// Receiving party decrypt package from String\nCryptPackage newPackage = new CryptPackage(packageString);\nString decryptedString = crypt.decrypt(newPackage, privateKey);\n```\n\n### Signing Strings\n```java\n// Init object\nStringSign sign = new StringSign();\n\n// generate key pair for demonstration (or each party reads either from storage)\nKeyPair kp = StringKeyTools.createKeyPair();\nKey privateKey = kp.getPrivate();\nKey publicKey = kp.getPublic();\n\n// sign String with private key and return signature as String\nString signature = sign.sign(message, privateKey);\n\n// ~~~ Do something with signature string, eg transmit over network\n\n// Receiving party can verify String with signature and public key of sender\nBoolean verified = sign.verify(message, signature, publicKey);\n```\n\n## Credits\nSome elements are inspired from https://github.com/william-ferguson-au/asymmetric-crypto but I\nchose to simplify it even down to only two classes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbehringer24%2Fstringcrypt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbehringer24%2Fstringcrypt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbehringer24%2Fstringcrypt/lists"}