{"id":38363133,"url":"https://github.com/sniper365/golang-crypto-package","last_synced_at":"2026-01-17T03:21:29.276Z","repository":{"id":57663018,"uuid":"374216407","full_name":"sniper365/golang-crypto-package","owner":"sniper365","description":"GoLang Crypto operations - AES, HMAC, Checksum and RSA Encrypt Decrypt","archived":false,"fork":false,"pushed_at":"2021-08-06T21:10:08.000Z","size":21,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T01:53:20.351Z","etag":null,"topics":["aes-encryption","crypto","go","hash","rsa-encryption-decryption"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sniper365.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}},"created_at":"2021-06-05T21:35:58.000Z","updated_at":"2021-08-06T21:10:12.000Z","dependencies_parsed_at":"2022-09-13T00:32:32.226Z","dependency_job_id":null,"html_url":"https://github.com/sniper365/golang-crypto-package","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sniper365/golang-crypto-package","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sniper365%2Fgolang-crypto-package","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sniper365%2Fgolang-crypto-package/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sniper365%2Fgolang-crypto-package/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sniper365%2Fgolang-crypto-package/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sniper365","download_url":"https://codeload.github.com/sniper365/golang-crypto-package/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sniper365%2Fgolang-crypto-package/sbom","scorecard":{"id":834632,"data":{"date":"2025-08-11","repo":{"name":"github.com/sniper365/golang-crypto-package","commit":"6b03a2c5b809d57df91e9062060cf78ebaea35fa"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/27 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: The Unlicense: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-23T18:39:22.130Z","repository_id":57663018,"created_at":"2025-08-23T18:39:22.131Z","updated_at":"2025-08-23T18:39:22.131Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28492697,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T02:39:23.645Z","status":"ssl_error","status_checked_at":"2026-01-17T02:34:19.649Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["aes-encryption","crypto","go","hash","rsa-encryption-decryption"],"created_at":"2026-01-17T03:21:29.182Z","updated_at":"2026-01-17T03:21:29.265Z","avatar_url":"https://github.com/sniper365.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# crypto\nA base crypto package for GoLang. Provides easy crypto operations for - AES, HMAC, Checksum and RSA Encrypt Decrypt\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/vdparikh/crypto)](https://goreportcard.com/report/github.com/sniper365/golang-crypto-package)\n\n```\ngo get -u github.com/sniper365/golang-crypto-package\n```\n\n### Tests\n```\ngo test -v\n=== RUN   TestAesEncryptDecrypt\n--- PASS: TestAesEncryptDecrypt (0.00s)\n=== RUN   TestRsaEncryptDecrypt\n--- PASS: TestRsaEncryptDecrypt (0.00s)\n=== RUN   TestHmac\n--- PASS: TestHmac (0.00s)\n=== RUN   TestChecksum\n--- PASS: TestChecksum (0.00s)\nPASS\nok  \tcrypto/crypto\t0.029s\n```\n\n### Benchmarks\n```\ngo test -bench=.\ngoos: darwin\ngoarch: amd64\npkg: github.com/sniper365/golang-crypto-package\nBenchmarkAesEncrypt-8   \t 1000000\t      1948 ns/op\nBenchmarkAesDecrypt-8   \t 1000000\t      1175 ns/op\nBenchmarkRsaEncrypt-8   \t   20000\t     96785 ns/op\nBenchmarkRsaDecrypt-8   \t   10000\t    210501 ns/op\nBenchmarkHmac-8         \t  500000\t      2535 ns/op\nBenchmarkChecksum-8     \t 3000000\t       496 ns/op\nPASS\nok  \tgithub.com/sniper365/golang-crypto-package\t13.315s\n```\n\n### Coverage\n```\ngo test -cover\nPASS\ncoverage: 77.0% of statements\nok  \tgithub.com/sniper365/golang-crypto-package\t0.029s\n```\n\n### Usage\nCheckout the example file in the `example` folder\n```go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"encoding/base64\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/sniper365/golang-crypto-package\"\n)\n\n/*\n## Creating RSA Public/Private Key Pair\nopenssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:2048\nopenssl rsa -in private_key.pem -out private_key.pem\nopenssl rsa -pubout -in private_key.pem -out public_key.pem\n*/\n\nfunc main() {\n\tkey := []byte(\"1234543444555666\")\n\tcryptValue := \"This is a long text which will be encrypted\"\n\terr := ioutil.WriteFile(\"/tmp/temp_file\", []byte(cryptValue), 0644)\n\n\tlog.Println(\"Performing Operations on \", cryptValue)\n\t// AES Encrypt\n\tencryptedValue, err := crypto.AesEncrypt([]byte(cryptValue), key)\n\tif err == nil {\n\t\tlog.Print(\"Encrypted Value: \", encryptedValue)\n\t}\n\n\tdecryptedValue, err := crypto.AesDecrypt(encryptedValue, key)\n\tif err == nil {\n\t\tlog.Println(\"Decrypted Value: \", string(decryptedValue))\n\t}\n\n\thmacValue := crypto.HmacValue([]byte(cryptValue), key)\n\tif err == nil {\n\t\tlog.Println(\"HMAC Value: \", hmacValue)\n\t}\n\n\tchecksum := crypto.Checksum([]byte(cryptValue))\n\tif err == nil {\n\t\tlog.Println(\"Checksum Value: \", checksum)\n\t}\n\n\tchecksumFile := crypto.ChecksumFile(\"/tmp/temp_file\")\n\tif err == nil {\n\t\tlog.Println(\"Checksum File Value: \", checksumFile)\n\t}\n\n\tpubKeyBytes := readFile(\"public_key.pem\")\n\trsaEncryptedValue, err := crypto.RsaEncrypt([]byte(cryptValue), pubKeyBytes)\n\tif err == nil {\n\t\trsaEncryptedValueEncoded := base64.StdEncoding.EncodeToString(rsaEncryptedValue)\n\t\tlog.Println(\"RSA Encrypted Value: \", rsaEncryptedValueEncoded)\n\t}\n\n\tprivKeyBytes := readFile(\"private_key.pem\")\n\trsaDecryptedValue, err := crypto.RsaDecrypt(rsaEncryptedValue, privKeyBytes)\n\tif err == nil {\n\t\tlog.Println(\"RSA Encrypted Value: \", string(rsaDecryptedValue))\n\t}\n\n}\n\nfunc readFile(filename string) []byte {\n\tbuf := bytes.NewBuffer(nil)\n\tf, _ := os.Open(filename)\n\tio.Copy(buf, f)\n\tf.Close()\n\n\ts := buf.Bytes()\n\treturn s\n}\n```\n\n\n### Sample Script Output\n```shell\ngo run main.go \nINFO[0000] Performing Operations on This is a long text which will be encrypted \nINFO[0000] Encrypted Value: g6Fj2gAwOKX9QpLyER/5yhLh8it7sw8wxOrlFe2o/AHDd+N/HequAMJXA2Pau2CwhXB68rRvoWmwZaukNK5L2zp3RWbUxd+UDaFroA== \nINFO[0000] Decrypted Value:  This is a long text which will be encrypted \nINFO[0000] HMAC Value:  ZTFiNTFlYTQyYWFmNzI2ZTY5MDQ5NzYzODQ4OTU3MzEwOWQyNTNlNjhjMmMwN2U1MDVhZGE0ZThhNjkwMWI0YjVjMDAzOWNjMmZlNzQ3NDdhYjI3OWJjZTM5NTk1MjFiNDU1OTA5YjI4ZGRlZDEzYjYxMmE5NjI0OTJjMmNhNjY= \nINFO[0000] Checksum Value:  091d3d091d2e8359cb56a881a3e2c92c5a6708996a017dcbf17979119fb630ca \nINFO[0000] Checksum File Value:  091d3d091d2e8359cb56a881a3e2c92c5a6708996a017dcbf17979119fb630ca \nINFO[0000] RSA Encrypted Value:  nKVVuCY7bPzNvfCx+NCa/3QYiliinc2Jhuvf7ZQTc87ZvcDOWiQwvXfkicLLv9WqqjmvzxWGTqxeJvN9Gw9SzRUAadgeQapS4VRR5VoTYsIEs8ye9yyyWzeAf6tp1bsj6GclE3MozPYcC4GMeeyGsrVb1JReNboUxZYOYd5wdqAwwG9MJtaq7pO2rFE7vkP3TGBlP53DzjAttFTilGV/2IbvyRmGUZsuyrKc4nJt+wvzPUVulzMcnqD9wRBPkAJ66SnxK/floYeCLt7U006om+xr19R+JKjLtzO9SDy8YNsv5++jUYhKcjfcts3BSExqO+HhJ5inswr9uRsOvJrvPg== \nINFO[0000] RSA Encrypted Value:  This is a long text which will be encrypted \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsniper365%2Fgolang-crypto-package","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsniper365%2Fgolang-crypto-package","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsniper365%2Fgolang-crypto-package/lists"}