{"id":21948159,"url":"https://github.com/evolution-gaming/crypto","last_synced_at":"2025-04-23T00:16:55.128Z","repository":{"id":12259198,"uuid":"71363519","full_name":"evolution-gaming/crypto","owner":"evolution-gaming","description":"crypto","archived":false,"fork":false,"pushed_at":"2024-07-29T14:03:20.000Z","size":119,"stargazers_count":4,"open_issues_count":19,"forks_count":5,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-23T00:16:47.910Z","etag":null,"topics":["crypto","scala"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/evolution-gaming.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-19T14:04:55.000Z","updated_at":"2024-07-18T09:43:27.000Z","dependencies_parsed_at":"2024-05-07T14:27:15.679Z","dependency_job_id":null,"html_url":"https://github.com/evolution-gaming/crypto","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evolution-gaming%2Fcrypto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evolution-gaming%2Fcrypto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evolution-gaming%2Fcrypto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evolution-gaming%2Fcrypto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evolution-gaming","download_url":"https://codeload.github.com/evolution-gaming/crypto/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250343960,"owners_count":21415042,"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":["crypto","scala"],"created_at":"2024-11-29T05:12:14.372Z","updated_at":"2025-04-23T00:16:55.104Z","avatar_url":"https://github.com/evolution-gaming.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Crypto \n[![Build Status](https://github.com/evolution-gaming/crypto/workflows/CI/badge.svg)](https://github.com/evolution-gaming/crypto/actions?query=workflow%3ACI)\n[![Coverage Status](https://coveralls.io/repos/github/evolution-gaming/crypto/badge.svg?branch=master)](https://coveralls.io/github/evolution-gaming/crypto?branch=master)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/1678ea6c4ac94c10a5cd9c1fc4f51fd4)](https://www.codacy.com/gh/evolution-gaming/crypto/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=evolution-gaming/crypto\u0026amp;utm_campaign=Badge_Grade)\n[![Version](https://img.shields.io/badge/version-click-blue)](https://evolution.jfrog.io/artifactory/api/search/latestVersion?g=com.evolutiongaming\u0026a=crypto_2.13\u0026repos=public)\n[![License](https://img.shields.io/badge/License-Apache%202.0-yellowgreen.svg)](https://opensource.org/licenses/Apache-2.0)\n\nA library that facilitates decrypting passwords using an application secret stored in a [Typesafe Config](https://github.com/typesafehub/config) file.\n\nWhen combined with an approach where the config file used is provided upon deployment and dynamically selected based on an environment variable it helps to avoid storing sensitive passwords in source control, while still allowing development configurations to be stored in source control. \n\nPartially based on code from the [Play! framework](https://www.playframework.com/).\n\nHow to use\n===========\n\nAdd the library to your dependencies list\n\n```scala\naddSbtPlugin(\"com.evolution\" % \"sbt-artifactory-plugin\" % \"0.0.2\")\n\nlibraryDependencies += \"com.evolutiongaming\" %% \"crypto\" % \"2.1.0\"\n```\n\nCreate an application config file `environments/default.conf`:\n\n```hocon\nencryptedPasswords = true\napplication {\n  secret = \"abcdefghijklmnop\" // only for example purposes, you should use a strong randomly generated secret\n}\n\npassword = \"3-DG4i9kr/lboBjhjgwMsT/2f1Jc6vI4O9VucM+ucM7TDi9Q==\" // use com.evolutiongaming.crypto.Encrypt app to encrypt\n```\n\nUse the library as follows\n\n```scala\nimport com.evolutiongaming.crypto.DecryptConfig\nimport com.typesafe.config.ConfigFactory\n\nval environmentKey = \"ENVIRONMENT\"\nval environment = System.getenv(environmentKey).orElse(sys.props.get(environmentKey).getOrElse(\"default\")) // select the environment to use\nval config = ConfigFactory.parseResourcesAnySyntax(s\"environments/$environment\") // load the config file\n\nval password = config.getString(\"password\") // the encrypted password to decrypt\nval decrypted = DecryptConfig(password, config) // decrypting the password \n\n// now you can use the decrypted value to authenticate to external services\n ```\n\nExamples\n========\n\nFor more examples you can review [DecryptConfigSpec](https://github.com/evolution-gaming/crypto/tree/master/src/test/scala/com/evolutiongaming/crypto/DecryptConfigSpec.scala).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevolution-gaming%2Fcrypto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevolution-gaming%2Fcrypto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevolution-gaming%2Fcrypto/lists"}