{"id":26848160,"url":"https://github.com/namdevel/go-crypt","last_synced_at":"2025-04-30T22:46:54.194Z","repository":{"id":65423851,"uuid":"587813338","full_name":"namdevel/go-crypt","owner":"namdevel","description":"AES Encrypt Decrypt String With Key (Base64, Gzip, HEX)","archived":false,"fork":false,"pushed_at":"2023-01-11T16:57:24.000Z","size":3,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-30T22:46:50.658Z","etag":null,"topics":["aes","decryption-algorithm","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/namdevel.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":"2023-01-11T16:41:37.000Z","updated_at":"2023-03-02T23:09:51.000Z","dependencies_parsed_at":"2023-02-09T03:46:18.670Z","dependency_job_id":null,"html_url":"https://github.com/namdevel/go-crypt","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/namdevel%2Fgo-crypt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namdevel%2Fgo-crypt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namdevel%2Fgo-crypt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namdevel%2Fgo-crypt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/namdevel","download_url":"https://codeload.github.com/namdevel/go-crypt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251795388,"owners_count":21645019,"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":["aes","decryption-algorithm","encryption-decryption"],"created_at":"2025-03-30T20:40:49.620Z","updated_at":"2025-04-30T22:46:54.172Z","avatar_url":"https://github.com/namdevel.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-crypt\n\n```\ngo get github.com/namdevel/go-crypt/crypto\n```\n\n### Key \u0026 String\n```go\n  plaintext := []byte(\"example plaintext\")\n  // Key for encryption and decryption\n  key := []byte(\"example key 1234\")\n```\n\n### AES Base64\n```go\n    // Encrypt plaintext to AES then encode to Hex\n    EncB64, err := crypto.EncB64(plaintext, key)\n    if err != nil {\n        fmt.Println(err)\n        return\n    }\n    fmt.Printf(\"1. - AESBase64 Encrypted:%s\\n\", EncB64)\n\n    // Decrypt Base64 Cipher to AES then decode to plaintext\n    DecB64, err := crypto.DecB64(EncB64, key)\n    if err != nil {\n        fmt.Println(err)\n        return\n    }\n    fmt.Printf(\"   - AESBase64 Decrypted : %s\\n\\n\", DecB64)\n```\n\n### AES Gzip Compress\n```go\n    // Encrypt plaintext to AES then encode to Gzip Compressed\n    EncGzip, err := crypto.EncGzip(plaintext, key)\n    if err != nil {\n        fmt.Println(err)\n        return\n    }\n    fmt.Printf(\"2. - AESGzip Encrypted:%s\\n\", EncGzip)\n\n    // Decrypt Gzip Compressed Cipher to AES then decode to plaintext\n    DecGzip, err := crypto.DecGzip(EncGzip, key)\n    if err != nil {\n        fmt.Println(err)\n        return\n    }\n    fmt.Printf(\"   - AESGzip Decrypted : %s\\n\\n\", DecGzip)\n```\n\n### AES Hex\n```go\n   // Encrypt plaintext to AES then encode to Hex\n\tEncHex, err := crypto.EncHex(plaintext, key)\n    if err != nil {\n        fmt.Println(err)\n        return\n    }\n    fmt.Printf(\"3. - AESHex Encrypted:%s\\n\", EncHex)\n\n    // Decrypt Hex Cipher to AES then decode to plaintext\n    DecHex, err := crypto.DecHex(EncHex, key)\n    if err != nil {\n        fmt.Println(err)\n        return\n    }\n    fmt.Printf(\"   - AESHex Decrypted : %s\\n\\n\", DecHex)\n```\n\n### Example\n```\n1. - AESBase64 Encrypted:AAAAAAAAAAAAAAAA6rZStyscF5jffw8oeBuVgeop9iPEx9z3tRbF5ZHf1Q4eXg5ZGZV1fjsufRkrrKDE\n   - AESBase64 Decrypted : example plaintext\n\n2. - AESGzip Encrypted:�E;�[pr���$�^��1�s��\u0004\u001f�������F�� �����\"�\u0013}\u0013b����\u0015����z�\u0016��\u0017�M\n   - AESGzip Decrypted : example plaintext\n\n3. - AESHex Encrypted:000000000000000000000000eab652b72b1c1798df7f0f28781b9581ea29f623c4c7dcf7b516c5e591dfd50e1e5e0e591995757e3b2e7d192baca0c4\n   - AESHex Decrypted : example plaintext\n```\n\nLicense\n------------\n\nThis open-source software is distributed under the MIT License. See LICENSE.md\n\nContributing\n------------\n\nAll kinds of contributions are welcome - code, tests, documentation, bug reports, new features, etc...\n\n* Send feedbacks.\n* Submit bug reports.\n* Write/Edit the documents.\n* Fix bugs or add new features.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnamdevel%2Fgo-crypt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnamdevel%2Fgo-crypt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnamdevel%2Fgo-crypt/lists"}