{"id":24901759,"url":"https://github.com/antonsjava/sprops","last_synced_at":"2025-07-05T09:38:25.261Z","repository":{"id":57732425,"uuid":"178417421","full_name":"antonsjava/sprops","owner":"antonsjava","description":"Password protected property files","archived":false,"fork":false,"pushed_at":"2021-12-15T20:34:49.000Z","size":33,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T18:19:51.005Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/antonsjava.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":"2019-03-29T14:09:32.000Z","updated_at":"2021-12-15T20:34:52.000Z","dependencies_parsed_at":"2022-09-10T19:52:08.043Z","dependency_job_id":null,"html_url":"https://github.com/antonsjava/sprops","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/antonsjava/sprops","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonsjava%2Fsprops","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonsjava%2Fsprops/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonsjava%2Fsprops/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonsjava%2Fsprops/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antonsjava","download_url":"https://codeload.github.com/antonsjava/sprops/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonsjava%2Fsprops/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263607061,"owners_count":23487736,"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":"2025-02-01T21:17:40.251Z","updated_at":"2025-07-05T09:38:25.224Z","avatar_url":"https://github.com/antonsjava.png","language":"Java","readme":"\n# sprops\n\nsprops is small library for encoding and decoding property files or simple \nstring data.\n\nMotivation for this project was to have possibility to store secret data like passwords \ntogether with sources or have it stored somewhere else publicly.\n\nProperty file with encoded properties are protected with one password. This must be \nprovided 'secretly' but this one only.\n\n## sprops-tool\n\nThis is command line tool for manipulating the property files. Tool can be build by \nbuilding this project.\n\nThan you can use it for encoding and decoding properties in property file \n\nLets have simple property file like \n\n```\n  main.db.password=xxxx\n  email.server.password=yyyy\n```\n\nthan you can call \n\n```\n  /tmp/aaa\u003e java -jar sprops-tool.jar -fencode passwords.properties  main.db.password\n  INF   main command to execute FileEncodeCommand\n  Enter password: \n  INF c.fenc Property: 'main.db.password'\n  INF c.fenc Encoding string from: 'xxxx'\n  INF c.fenc                   to: 'sprops:AAAAIBnzWe9H8rJtXVsOtBApsVC74BldooOGHOu4h1GJWuMpMpWXnD3b/vYurPjmHYM1Ww=='\n  INF   main command FileEncodeCommand execution done.\n```\n\nand property looks like \n\n```\n  main.db.password=sprops:AAAAIBnzWe9H8rJtXVsOtBApsVC74BldooOGHOu4h1GJWuMpMpWXnD3b/vYurPjmHYM1Ww==\n  email.server.password=yyyy\n```\n\nyou can than call \n\n```\n  /tmp/aaa\u003e java -jar sprops-tool.jar -fdecode passwords.properties  main.db.password\n  INF   main command to execute FileDecodeCommand\n  Enter password: \n  INF c.fdec Property: 'main.db.password'\n  INF c.fdec Encoding string from: 'sprops:AAAAIBnzWe9H8rJtXVsOtBApsVC74BldooOGHOu4h1GJWuMpMpWXnD3b/vYurPjmHYM1Ww=='\n  INF c.fdec                   to: 'xxxx'\n  INF   main command FileDecodeCommand execution done.\n```\n\nand property looks like \n\n```\n  main.db.password=xxxx\n  email.server.password=yyyy\n```\n\nThere are also other options you can see it with --help option.\n\n## Property file usage\n\nEncoded file can be used in application \n\n```java\n  String password = .....\n  Properties encodedProps = .....\n  PropertiesEncoder encoder = PropertiesEncoder.instance(password);\n  encoder.add(encodedProps);\n  String decodedProperty = encoder.getProperty(\"property.name\");\n  Properties decodedProps = encoder.decode();\n```\n\n## Simple encoding/decoding\n\nYou can use \n\n```java\n  String password = .....\n  String text = .....\n  SimpleEncoder encoder = SimpleEncoder.instance(password);\n  String encodedString = encoder.encode(text);\n  String decodedString = encoder.decode(encodedString);\n```\n\n## System properties utility\n\nIf you are using spring boot and you want to have encoded properties provide as \nSB property. An easy way is copy the properties to System properties at wery \nfirst moment of starting application\n\n```java\n  Properties props = .....\n  SystemPropertiesUpdater.instance(props)\n    .map(\"main.db.password\", \"spring.datasource.password\")\n    .map(\"email.server.password\", \"myapp.notifier.password\");\n```\n\n## Maven usage\n\n```\n   \u003cdependency\u003e\n      \u003cgroupId\u003eio.github.antonsjava\u003c/groupId\u003e\n      \u003cartifactId\u003esprops\u003c/artifactId\u003e\n      \u003cversion\u003eLATESTVERSION\u003c/version\u003e\n   \u003c/dependency\u003e\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonsjava%2Fsprops","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantonsjava%2Fsprops","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonsjava%2Fsprops/lists"}