{"id":15865875,"url":"https://github.com/benjaminch/make-my-life-easier","last_synced_at":"2025-04-01T20:45:44.708Z","repository":{"id":57693926,"uuid":"74028890","full_name":"benjaminch/make-my-life-easier","owner":"benjaminch","description":"A couple scripts I use on a daily basis to make my life easier.","archived":false,"fork":false,"pushed_at":"2019-11-13T14:07:18.000Z","size":31,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-07T13:39:23.513Z","etag":null,"topics":["go","golang"],"latest_commit_sha":null,"homepage":null,"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/benjaminch.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":"2016-11-17T13:21:58.000Z","updated_at":"2019-11-13T14:07:20.000Z","dependencies_parsed_at":"2022-09-26T21:01:19.702Z","dependency_job_id":null,"html_url":"https://github.com/benjaminch/make-my-life-easier","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/benjaminch%2Fmake-my-life-easier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjaminch%2Fmake-my-life-easier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjaminch%2Fmake-my-life-easier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjaminch%2Fmake-my-life-easier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benjaminch","download_url":"https://codeload.github.com/benjaminch/make-my-life-easier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246709919,"owners_count":20821298,"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":["go","golang"],"created_at":"2024-10-05T23:02:09.573Z","updated_at":"2025-04-01T20:45:44.690Z","avatar_url":"https://github.com/benjaminch.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Report Card](https://goreportcard.com/badge/github.com/benjaminch/make-my-life-easier)](https://goreportcard.com/report/github.com/benjaminch/make-my-life-easier)\n\n# make-my-life-easier\nA couple scripts I use on a daily basis to make my life easier.\nThey are all ready to go command line tools :)\n\n## Installation\n### Preliminary\n- `go` needs to be installed, version 1.12 or above\n### Pulling the code\n- retrieve the code from the repo\n-- go get github.com/benjaminch/make-my-life-easier\n- or install the module + code\n-- go install github.com/benjaminch/make-my-life-easier\n### Launching the code\n- run `go run mmle.go help`\n\n## Price encryption / decryption (Google Private Data specs)\n### Usage examples\n#### Help\n```\ngo run mmle.go help\nusage: mmle [\u003cflags\u003e] \u003ccommand\u003e [\u003cargs\u003e ...]\n\nFlags:\n      --help     Show context-sensitive help (also try --help-long and --help-man).\n  -v, --verbose  Verbose mode.\n\nCommands:\n  help [\u003ccommand\u003e...]\n    Show help.\n\n  price-encryption [\u003cflags\u003e] \u003cekey\u003e \u003cikey\u003e \u003cprice\u003e\n    Encrypt a price using a given algorithm.\n\n  price-decryption [\u003cflags\u003e] \u003cekey\u003e \u003cikey\u003e \u003cprice\u003e\n    Decrypt a price using a given algorithm.\n\n  hex-key-generator [\u003ckeylength\u003e]\n    Generate a random hex key of the specified length (by default: 64)\n```\n#### Decrypt only\nThe command line below will try to decrypt the encrypted price passed in command line.\n```\ngo run mmle.go price-decryption [YOUR_EKEY] [YOUR_IKEY] [ENCRYPTED_PRICE]\n```\nDetails:\n```\nusage: mmle price-decryption [\u003cflags\u003e] \u003cekey\u003e \u003cikey\u003e \u003cprice\u003e\n\nDecrypt a price using a given algorithm.\n\nFlags:\n      --help              Show context-sensitive help (also try --help-long and --help-man).\n  -v, --verbose           Verbose mode.\n      --algorithm=google  Name of the algorithm\n      --keystype=hexa     Keys type\n      --keysb64           Keys are base 64.\n      --scale=1000000     Price scale factor\n\nArgs:\n  \u003cekey\u003e   Encryption key\n  \u003cikey\u003e   Integrity key\n  \u003cprice\u003e  Price to decrypt\n```\n#### Encrypt only\nThe command line below will try to encrypt the clear price passed in command line.\n```\ngo run mmle.go price-encryption [YOUR_EKEY] [YOUR_IKEY] [CLEAR_PRICE]\n```\nDetails:\n```\nusage: mmle price-encryption [\u003cflags\u003e] \u003cekey\u003e \u003cikey\u003e \u003cprice\u003e\n\nEncrypt a price using a given algorithm.\n\nFlags:\n      --help              Show context-sensitive help (also try --help-long and --help-man).\n  -v, --verbose           Verbose mode.\n      --algorithm=google  Name of the algorithm\n      --keystype=hexa     Keys type\n      --keysb64           Keys are base 64.\n      --scale=1000000     Price scale factor\n      --seed=\"\"           Seed\n\nArgs:\n  \u003cekey\u003e   Encryption key\n  \u003cikey\u003e   Integrity key\n  \u003cprice\u003e  Price to encrypt\n```\n### Verbose mode\nThe verbose mode describle the process step by steps.\n```\ngo run mmle.go price-encryption [YOUR_EKEY] [YOUR_IKEY] [CLEAR_PRICE] --verbose\nVerbose activated\nKeys decoding mode :  utf-8\nEncryption key :  6356770B3C111C07F778AFD69F16643E9110090FD4C479D91181EED2523788F1\nEncryption key (bytes) :  [99 86 119 11 60 17 28 7 247 120 175 214 159 22 100 62 145 16 9 15 212 196 121 217 17 129 238 210 82 55 136 241]\nIntegrity key :  3588BF6D387E8AEAD4EEC66798255369AF47BFD48B056E8934CEFEF3609C469E\nIntegrity key (bytes) :  [53 136 191 109 56 126 138 234 212 238 198 103 152 37 83 105 175 71 191 212 139 5 110 137 52 206 254 243 96 156 70 158]\nERROR: logging before flag.Parse: I0329 16:58:01.062251   19950 helpers.go:109] Micro price bytes: [0 0 0 0 0 22 90 168]\nSeed :\nInitialization vector :  [212 29 140 217 143 0 178 4 233 128 9 152 236 248 66 126]\n// pad = hmac(e_key, iv), first 8 bytes\nPad :  [125 170 63 123 246 12 99 173]\n// enc_data = pad \u003cxor\u003e data\nEncoded price bytes :  [125 170 63 123 246 26 57 5]\n// signature = hmac(i_key, data || iv), first 4 bytes\nSignature :  [74 124 216 232]\nEncrypted price:  1B2M2Y8AsgTpgAmY7PhCfn2qP3v2GjkFSnzY6A==\n```\n\n## Hexa keys generation\n### Usage examples\nThe command line below will generate an hexa key of the desired length (by default, 64 bytes).\n```\ngo run mmle.go hex-key-generator\ngo run mmle.go hex-key-generator --keylength=32\n```\nDetails:\n```\nusage: mmle hex-key-generator [\u003cflags\u003e]\n\nGenerate a random hex key of the specified length (by default: 64)\n\nFlags:\n      --help          Show context-sensitive help (also try --help-long and --help-man).\n  -v, --verbose       Verbose mode.\n      --keylength=32  Key Length\n```\n\n## Base64 to Base64 web safe and Base64 web safe to Base64\n### Usage examples\nTODO\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjaminch%2Fmake-my-life-easier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenjaminch%2Fmake-my-life-easier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjaminch%2Fmake-my-life-easier/lists"}