{"id":19775396,"url":"https://github.com/watchakorn-18k/easycrypt","last_synced_at":"2025-02-28T05:28:23.961Z","repository":{"id":247771045,"uuid":"826800087","full_name":"watchakorn-18k/easycrypt","owner":"watchakorn-18k","description":"🔐 EasyCrypt is a Go package that provides straightforward encryption and decryption functionality using AES encryption with a passphrase.","archived":false,"fork":false,"pushed_at":"2024-07-10T13:58:38.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-11T01:30:02.821Z","etag":null,"topics":["encryption-decryption","go","go-module","golang"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/watchakorn-18k/easycrypt","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/watchakorn-18k.png","metadata":{"files":{"readme":".github/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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-10T12:01:13.000Z","updated_at":"2024-07-10T14:07:12.000Z","dependencies_parsed_at":"2024-07-10T14:27:24.756Z","dependency_job_id":null,"html_url":"https://github.com/watchakorn-18k/easycrypt","commit_stats":null,"previous_names":["watchakorn-18k/easycrypt"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watchakorn-18k%2Feasycrypt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watchakorn-18k%2Feasycrypt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watchakorn-18k%2Feasycrypt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watchakorn-18k%2Feasycrypt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/watchakorn-18k","download_url":"https://codeload.github.com/watchakorn-18k/easycrypt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241105879,"owners_count":19910711,"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":["encryption-decryption","go","go-module","golang"],"created_at":"2024-11-12T05:15:57.451Z","updated_at":"2025-02-28T05:28:23.939Z","avatar_url":"https://github.com/watchakorn-18k.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n\u003cdiv align=\"center\"\u003e\n\n# EasyCrypt\n\n\u003c/div\u003e\n\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://goreportcard.com/report/github.com/watchakorn-18k/easycrypt\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/%F0%9F%93%9D%20goreport-A%2B-75C46B?style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://pkg.go.dev/github.com/watchakorn-18k/easycrypt\"\u003e\u003cimg src=\"https://pkg.go.dev/badge/github.com/watchakorn-18k/easycrypt.svg\" alt=\"Go Reference\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\n🔐 EasyCrypt is a Go package that provides straightforward encryption and decryption functionality using AES encryption with a passphrase.\n\n## Project Origin\n\n🤖 This project originated from ChatGPT, but I injected some creative ideas to bring this code to life. So, while I won't claim to be the creator, let's just have fun with it! 😎\n\n## Installation\n\nTo use EasyCrypt, ensure you have Go installed and configured. Use the following command to install the package:\n\n```sh\ngo get github.com/watchakorn-18k/easycrypt\n```\n\n## Usage\n\nImport EasyCrypt in your Go code:\n\n```go\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/watchakorn-18k/easycrypt\"\n)\n```\n\n### Functions\n\n#### generateKey\n\n```go\nfunc generateKey(passphrase string) []byte\n```\n\nGenerates a 32-byte key from a passphrase using SHA-256.\n\n#### Encrypt\n\n```go\nfunc Encrypt(passphrase, plaintext string) (string, error)\n```\n\nEncrypts the provided plaintext using AES encryption with the given passphrase. Returns the base64 URL encoded ciphertext and any encountered error.\n\n#### Decrypt\n\n```go\nfunc Decrypt(passphrase, cryptoText string) (string, error)\n```\n\nDecrypts the base64 encoded ciphertext using AES encryption with the provided passphrase. Returns the plaintext and any encountered error.\n\n### Example\n\n```go\npackage main\n\nimport \"github.com/watchakorn-18k/easycrypt\"\n\nfunc main() {\n\tsecretKey := \"password\"\n\ttext := \"wk18k\"\n\t// Encrypt the plaintext\n\tencrypted, err := easycrypt.Encrypt(secretKey, text)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tprintln(\"encrypted: \", encrypted)\n\n\t// Decrypt the encrypted text\n\tdecrypted, err := easycrypt.Decrypt(secretKey, encrypted)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tprintln(\"decrypted: \", decrypted)\n}\n```\n\n## License\n\nThis project is licensed under the Unlicense license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwatchakorn-18k%2Feasycrypt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwatchakorn-18k%2Feasycrypt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwatchakorn-18k%2Feasycrypt/lists"}