{"id":18053298,"url":"https://github.com/luzifer/go-openssl","last_synced_at":"2025-05-15T16:01:53.380Z","repository":{"id":48911917,"uuid":"39276766","full_name":"Luzifer/go-openssl","owner":"Luzifer","description":"go-openssl is a small library wrapping the crypto/aes functions in a way the output is compatible to OpenSSL","archived":false,"fork":false,"pushed_at":"2024-12-12T11:23:30.000Z","size":92,"stargazers_count":124,"open_issues_count":2,"forks_count":32,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-07T21:11:12.587Z","etag":null,"topics":["golang","library","openssl"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Luzifer.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":"LICENSE","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},"funding":{"custom":["https://www.paypal.me/luzifer"],"github":["Luzifer"],"ko_fi":"luziferus"}},"created_at":"2015-07-17T21:49:26.000Z","updated_at":"2025-03-10T15:43:37.000Z","dependencies_parsed_at":"2023-12-19T15:10:27.073Z","dependency_job_id":"390a8982-4964-4a07-a7c2-cbe9699af04a","html_url":"https://github.com/Luzifer/go-openssl","commit_stats":{"total_commits":48,"total_committers":6,"mean_commits":8.0,"dds":0.125,"last_synced_commit":"09f71957dadea1cd288accd53bbe1a5bf9824a83"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luzifer%2Fgo-openssl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luzifer%2Fgo-openssl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luzifer%2Fgo-openssl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luzifer%2Fgo-openssl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Luzifer","download_url":"https://codeload.github.com/Luzifer/go-openssl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254364343,"owners_count":22058907,"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":["golang","library","openssl"],"created_at":"2024-10-30T23:16:44.883Z","updated_at":"2025-05-15T16:01:53.228Z","avatar_url":"https://github.com/Luzifer.png","language":"Go","funding_links":["https://www.paypal.me/luzifer","https://github.com/sponsors/Luzifer","https://ko-fi.com/luziferus"],"categories":[],"sub_categories":[],"readme":"[![](https://badges.fyi/static/godoc/reference/5272B4)](https://pkg.go.dev/github.com/Luzifer/go-openssl/v4)\n[![Go Report Card](https://goreportcard.com/badge/github.com/Luzifer/go-openssl)](https://goreportcard.com/report/github.com/Luzifer/go-openssl)\n![](https://badges.fyi/github/license/Luzifer/go-openssl)\n![](https://badges.fyi/github/latest-tag/Luzifer/go-openssl)\n[![](https://travis-ci.org/Luzifer/go-openssl.svg?branch=master)](https://travis-ci.org/Luzifer/go-openssl)\n\n# Luzifer / go-openssl\n\n`go-openssl` is a small library wrapping the `crypto/aes` functions in a way the output is compatible to OpenSSL / CryptoJS. For all encryption / decryption processes AES256 is used so this library will not be able to decrypt messages generated with other than `openssl aes-256-cbc`. If you're using CryptoJS to process the data you also need to use AES256 on that side.\n\n## Version support\n\nFor this library only the latest major version is supported. All prior major versions should no longer be used.\n\nThe versioning is following [SemVer](https://semver.org/) which means upgrading to a newer major version will break your code!\n\n## OpenSSL compatibility\n\n### 1.1.0c\n\nStarting with `v2.0.0` `go-openssl` generates the encryption keys using `sha256sum` algorithm. This is the default introduced in OpenSSL 1.1.0c. When encrypting data you can choose which digest method to use and therefore also continue to use `md5sum`. When decrypting OpenSSL encrypted data `md5sum`, `sha1sum` and `sha256sum` are supported.\n\n### 1.1.1\n\nStarting with `v4.0.0` `go-openssl` is capable of using the PBKDF2 key derivation method for encryption. You can choose to use it by passing the corresponding `CredsGenerator`.\n\n## Installation\n\n```bash\n# Get the latest version\ngo get github.com/Luzifer/go-openssl/v4\n```\n\n## Usage example\n\nThe usage is quite simple as you don't need any special knowledge about OpenSSL and/or AES256:\n\n### Encrypt\n\n```go\nimport (\n  \"fmt\"\n  openssl \"github.com/Luzifer/go-openssl/v4\"\n)\n\nfunc main() {\n  plaintext := \"Hello World!\"\n  passphrase := \"z4yH36a6zerhfE5427ZV\"\n\n  o := openssl.New()\n\n  enc, err := o.EncryptBytes(passphrase, []byte(plaintext), PBKDF2SHA256)\n  if err != nil {\n    fmt.Printf(\"An error occurred: %s\\n\", err)\n  }\n\n  fmt.Printf(\"Encrypted text: %s\\n\", string(enc))\n}\n```\n\n### Decrypt\n\n```go\nimport (\n  \"fmt\"\n  openssl \"github.com/Luzifer/go-openssl/v4\"\n)\n\nfunc main() {\n  opensslEncrypted := \"U2FsdGVkX19ZM5qQJGe/d5A/4pccgH+arBGTp+QnWPU=\"\n  passphrase := \"z4yH36a6zerhfE5427ZV\"\n\n  o := openssl.New()\n\n  dec, err := o.DecryptBytes(passphrase, []byte(opensslEncrypted), BytesToKeyMD5)\n  if err != nil {\n    fmt.Printf(\"An error occurred: %s\\n\", err)\n  }\n\n  fmt.Printf(\"Decrypted text: %s\\n\", string(dec))\n}\n```\n\n## Testing\n\nTo execute the tests for this library you need to be on a system having `/bin/bash` and `openssl` available as the compatibility of the output is tested directly against the `openssl` binary. The library itself should be usable on all operating systems supported by Go and `crypto/aes`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluzifer%2Fgo-openssl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluzifer%2Fgo-openssl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluzifer%2Fgo-openssl/lists"}