{"id":13486401,"url":"https://github.com/microgit-com/lucky_encrypted","last_synced_at":"2025-03-27T20:33:06.287Z","repository":{"id":48110063,"uuid":"242584289","full_name":"microgit-com/lucky_encrypted","owner":"microgit-com","description":"attribute_encrypted in Crystal for Lucky","archived":false,"fork":false,"pushed_at":"2024-05-25T16:20:48.000Z","size":19,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-01T18:26:45.893Z","etag":null,"topics":["crystal","encryption","lucky-framework"],"latest_commit_sha":null,"homepage":null,"language":"Crystal","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/microgit-com.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-02-23T20:17:48.000Z","updated_at":"2024-05-25T16:20:51.000Z","dependencies_parsed_at":"2024-01-25T20:03:54.371Z","dependency_job_id":"ac1a099f-bddc-44f5-aa72-075cad9a7590","html_url":"https://github.com/microgit-com/lucky_encrypted","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microgit-com%2Flucky_encrypted","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microgit-com%2Flucky_encrypted/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microgit-com%2Flucky_encrypted/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microgit-com%2Flucky_encrypted/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microgit-com","download_url":"https://codeload.github.com/microgit-com/lucky_encrypted/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222313947,"owners_count":16965414,"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":["crystal","encryption","lucky-framework"],"created_at":"2024-07-31T18:00:45.186Z","updated_at":"2024-10-30T21:31:35.226Z","avatar_url":"https://github.com/microgit-com.png","language":"Crystal","funding_links":[],"categories":[":gem: Lucky Shards"],"sub_categories":[],"readme":"# lucky_encrypted\n\nAn type for Lucky framework Avram that's encrypt a string before saving to a database and decrypts when getting it from db.\n\nit use defaults from Lucky's message encryptor class, which is using when last checked `aes-256-cbc` and the digest is `sha1`\n\nYou only need one column, as both the iv and the data is saved in one, splitted.\n\n## Installation\n\n1. Add the dependency to your `shard.yml`:\n\n   ```yaml\n   dependencies:\n     lucky_encrypted:\n       github: microgit-com/lucky_encrypted\n   ```\n\n2. Run `shards install`\n\n## Usage\n\n* add `require \"lucky_encrypted\"` in shards.cr\n* Create an column for the encrypted string you want to save with lucky migration, i use `otp_secret` as example.\n* set a config for LuckyEncrypted:\n  ```crystal\n  # In config/lucky_encrypted.cr\n  require \"./server\" # To get the configuration from the server\n  LuckyEncrypted.configure do |settings|\n    settings.secret = Lucky::Server.settings.secret_key_base\n  end\n  ```\n  you can use lucky's secret key base or generate a different secret with `lucky gen.secret_key`\n\n* Add the type `LuckyEncrypted::StringEncrypted` as type for that column in the model:\n\n  ```\n    column otp_secret : LuckyEncrypted::StringEncrypted\n  ```\n\nit shall now work. (famous last words)\n\n## Development\n\nusing stdlib spec and all. so just use the test and so forth.\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/microgit-com/lucky_encrypted/fork\u003e)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [Håkan Nylén](https://github.com/confact) - creator and maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrogit-com%2Flucky_encrypted","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrogit-com%2Flucky_encrypted","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrogit-com%2Flucky_encrypted/lists"}