{"id":19408586,"url":"https://github.com/4lessandrodev/saas-cryptography","last_synced_at":"2026-06-13T12:33:20.789Z","repository":{"id":105008281,"uuid":"416877572","full_name":"4lessandrodev/saas-cryptography","owner":"4lessandrodev","description":"a small project to test encryption as a service with nodejs","archived":false,"fork":false,"pushed_at":"2021-10-14T05:57:49.000Z","size":201,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-07T14:23:20.474Z","etag":null,"topics":["cryptography","encryption"],"latest_commit_sha":null,"homepage":"https://saas-encrypt.herokuapp.com/key","language":"TypeScript","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/4lessandrodev.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-13T19:46:55.000Z","updated_at":"2021-10-14T05:57:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"38d03e27-0440-4414-8ef8-f1e76453c87e","html_url":"https://github.com/4lessandrodev/saas-cryptography","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/4lessandrodev%2Fsaas-cryptography","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4lessandrodev%2Fsaas-cryptography/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4lessandrodev%2Fsaas-cryptography/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4lessandrodev%2Fsaas-cryptography/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/4lessandrodev","download_url":"https://codeload.github.com/4lessandrodev/saas-cryptography/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240587478,"owners_count":19825005,"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":["cryptography","encryption"],"created_at":"2024-11-10T12:06:40.491Z","updated_at":"2026-06-13T12:33:15.766Z","avatar_url":"https://github.com/4lessandrodev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cryptography as service\n\nThis app guarantees to encrypt and decrypt the request body.\nAll encryption is managed by internal keys and can only be used once per session.\n\n---\n\n## Generate a session\n\nThis session is an authentication.\nIt is not an encryption key. It only authorizes you to use the app.\nIt expires after 5 minutes or after being used to decrypt a data request.\n\n`GET http://localhost:3000/key`\n\nResult\n\n```json\n\n{\n    \"session\": \"129db5f5-5f00-4735-8792-ec621207661b\"\n}\n\n```\n\nOr\n\n```shell\ncurl https://saas-encrypt.herokuapp.com/key | xargs echo\n```\n\n---\n\n## Encrypt data\n\nThis endpoint encrypts all data provided in the request body.\nIt must be an object as shown below.\n\n`POST http://localhost:3000/encrypt`\n\nHeaders\n\n```json\n{\n    \"x-api-key\": \"129db5f5-5f00-4735-8792-ec621207661b\"\n}\n```\n\nBody\n\n```json\n\n{\n    \"data\": {\n        \"id\": \"e962c247-523e-43d9-bc2b-c4b4fceeef6f\",\n        \"userName\":\"Alessandro\"\n    }\n}\n\n```\n\nResult\n\n```json\n\n{\n    \"data\": \"472e7765a7d1f93befaf0d940c6f14448fc4a6f9764beb7e108f6838647036a47e28931f3e9071533d01df1af17d707ad6f5f76cf4835dbf0d15b7110a30c682308bda6f82\"\n}\n\n```\n\nOr\n\n```shell\ncurl -H \"Content-Type: application/json\" \\\n-H \"x-api-key: 129db5f5-5f00-4735-8792-ec621207661b\" \\\n-d '{\"data\":{\"id\":1,\"name\":\"Alessandro\"}}' \\\n-X POST https://saas-encrypt.herokuapp.com/encrypt | xargs echo\n```\n\n---\n\n## Decrypt data\n\nThis endpoint decrypts all data provided in the request body data as a string.\nIt can only be used once because the tag you generated in step 1 expires after the first use.\n\nHeaders\n\n```json\n{\n    \"x-api-key\": \"129db5f5-5f00-4735-8792-ec621207661b\"\n}\n```\n\nBody\n\n`POST http://localhost:3000/decrypt`\n\n```json\n{\n    \"data\": \"472e7765a7d1f93befaf0d940c6f14448fc4a6f9764beb7e108f6838647036a47e28931f3e9071533d01df1af17d707ad6f5f76cf4835dbf0d15b7110a30c682308bda6f82\"\n}\n\n```\n\nResult\n\n```json\n\n{\n    \"data\": {\n        \"id\": \"e962c247-523e-43d9-bc2b-c4b4fceeef6f\",\n        \"userName\":\"Alessandro\"\n    }\n}\n\n```\n\nOr\n\n```shell\ncurl -H \"Content-Type: application/json\" \\\n-H \"x-api-key: 129db5f5-5f00-4735-8792-ec621207661b\" \\\n-d '{\"data\":\"163cc6f688434b651db01ca478853dad913a18c1a771cb89b04a4d41\"}' \\\n-X POST https://saas-encrypt.herokuapp.com/decrypt | xargs echo\n```\n\n---\n\n## Todo\n\nOnly authorized applications can generate a session.\n\n- Implement authentication for api.\n- Implement JWT to expire access to the service.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4lessandrodev%2Fsaas-cryptography","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F4lessandrodev%2Fsaas-cryptography","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4lessandrodev%2Fsaas-cryptography/lists"}