{"id":19963210,"url":"https://github.com/rncryptor/rncryptor-go","last_synced_at":"2026-03-16T21:36:41.628Z","repository":{"id":24492328,"uuid":"27897181","full_name":"RNCryptor/RNCryptor-go","owner":"RNCryptor","description":"Go implementation of RNCryptor","archived":false,"fork":false,"pushed_at":"2017-09-23T06:28:25.000Z","size":188,"stargazers_count":20,"open_issues_count":3,"forks_count":12,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-08-21T12:49:50.067Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RNCryptor.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":"2014-12-11T23:38:40.000Z","updated_at":"2023-07-25T13:54:13.000Z","dependencies_parsed_at":"2022-08-22T18:00:36.887Z","dependency_job_id":null,"html_url":"https://github.com/RNCryptor/RNCryptor-go","commit_stats":null,"previous_names":["stevenschobert/rncryptor-go"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RNCryptor%2FRNCryptor-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RNCryptor%2FRNCryptor-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RNCryptor%2FRNCryptor-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RNCryptor%2FRNCryptor-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RNCryptor","download_url":"https://codeload.github.com/RNCryptor/RNCryptor-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224374655,"owners_count":17300691,"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-13T02:15:08.285Z","updated_at":"2026-01-12T06:34:40.168Z","avatar_url":"https://github.com/RNCryptor.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"RNCryptor-go\n============\n\nGo implementation of [RNCryptor](http://rncryptor.github.io).\n\n#### What is RNCryptor?\n\n\u003e RNCryptor is a data format specificiation for AES encryption, with AES-256, random-salted PBKDF2,\n\u003e AES-CBC, random IV, and HMAC. It has implementations in several languages.\n\nYou can head over to the [RNCryptor website](http://rncryptor.github.io) for more information,\nor checkout the [GitHub Organization](https://github.com/RNCryptor) for implementations in other\nlanguages.\n\n## Installation\n\n```sh\ngo get github.com/RNCryptor/RNCryptor-go\n```\n\n## Example\n\n```go\npackage main\n\nimport(\n  \"fmt\"\n  \"github.com/RNCryptor/RNCryptor-go\"\n)\n\nfunc main() {\n  pass := \"test\"\n  data := []byte(\"hello world\")\n\n  fmt.Printf(\"source: %v\\n\", string(data))\n\n  encrypted, _ := rncryptor.Encrypt(pass, data)\n  fmt.Printf(\"encrypted: %v\\n\", string(encrypted))\n\n  // if you need to send the encrypted data across\n  // the wire, you'll probably want to call\n  // `base64.StdEncoding.EncodeToString(encrypted)`\n  // to base64 the data rather than transmiting raw bytes\n\n  decrypted, _ := rncryptor.Decrypt(pass, encrypted)\n  fmt.Printf(\"decrypted: %v\\n\", string(decrypted))\n}\n```\n\n## API\n\n### Encrypt(password string, data []byte) ([]byte, error)\n\nEncrypts `data` using `password`. Automatically handles salting, iv-generation, and hmac signing.\nReturns the decrypted data, or an error, if encryption was unsuccessful.\n\n- Password must be at least 1 character long.\n\n```go\nencrypted, err := rncryptor.Encrypt(\"securepassword\", []byte(\"bytes to encrypt\"))\nif err != nil {\n  log.Printf(\"error encrypting data: %v\", err)\n}\n\n// from here, you can encode `encrypted` however you want\n// base64.StdEncoding.EncodeToString(encrypted)\n```\n\n### Decrypt(password string, data []byte) ([]byte, error)\n\nDecrypts `data` using `password`. Returns un-encrypted data, or an error if decryption is\nunsuccessful (e.g. password mismatch).\n\n- Password must match the password used during encryption\n\n```go\n// if the encrypted data has been encoded, you'll need to decode it first\n// base64.StdEncoding.DecodeString(\"base64data\")\n\ndecrypted, err := rncryptor.Decrypt(\"securepassword\", []byte(\"encrypted bytes\"))\nif err != nil {\n  log.Printf(\"error decrypting data: %v\", err)\n}\n```\n\n## Notes\n\nIf you'd like to help with any of the items below, send a pull-request!\n\n- Only supports [version\n  3](https://github.com/RNCryptor/RNCryptor-Spec/blob/0625abe597e67af4a9a40f460a10bc069b7caf48/RNCryptor-Spec-v3.md)\n  of the RNCryptor spec.\n- Only provides functions for password-based encryption, lacks function for [key-based\n  encryption](https://github.com/RNCryptor/RNCryptor-Spec/blob/0625abe597e67af4a9a40f460a10bc069b7caf48/RNCryptor-Spec-v3.md#key-based-encryption-abstract-language).\n\n\n## Contributing\n\nPlease read over [GitHub's guide on\ncontributing](https://guides.github.com/activities/contributing-to-open-source/) if you'd like to\nlend a hand!\n\n## Credits\n\nThanks to [Rob Napier](http://robnapier.net) and the maintainers of the various\n[RNCryptor implementations](https://github.com/RNCryptor) for all their hard work!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frncryptor%2Frncryptor-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frncryptor%2Frncryptor-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frncryptor%2Frncryptor-go/lists"}