{"id":29151265,"url":"https://github.com/karpeleslab/cryptutil","last_synced_at":"2025-07-10T15:34:05.883Z","repository":{"id":247377512,"uuid":"825654651","full_name":"KarpelesLab/cryptutil","owner":"KarpelesLab","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-29T07:16:15.000Z","size":82,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-01T00:08:56.763Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/KarpelesLab.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":"2024-07-08T08:51:27.000Z","updated_at":"2024-09-29T07:16:09.000Z","dependencies_parsed_at":"2024-08-24T06:37:25.221Z","dependency_job_id":"5d8cd3db-9a74-48c8-aff0-560ed25b2cea","html_url":"https://github.com/KarpelesLab/cryptutil","commit_stats":null,"previous_names":["karpeleslab/cryptutil"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/KarpelesLab/cryptutil","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarpelesLab%2Fcryptutil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarpelesLab%2Fcryptutil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarpelesLab%2Fcryptutil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarpelesLab%2Fcryptutil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KarpelesLab","download_url":"https://codeload.github.com/KarpelesLab/cryptutil/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarpelesLab%2Fcryptutil/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264599470,"owners_count":23635304,"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-07-01T00:08:57.203Z","updated_at":"2025-07-10T15:34:05.863Z","avatar_url":"https://github.com/KarpelesLab.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GoDoc](https://godoc.org/github.com/KarpelesLab/cryptutil?status.svg)](https://godoc.org/github.com/KarpelesLab/cryptutil)\n\n# cryptutil\n\nSome tools for handling common crypto tasks not found in the go standard library\n\n## ECDH Message encryption\n\nSometimes you want to send a message. Sometimes you want it encrypted. Sending an encrypted message to a ECDSA key can be painful and come with all sorts of difficulties.\n\nThis library aims to provide a simple encryption/decryption scheme that just takes a plaintext and a key and returns an encrypted string.\n\nThe decryption function accepts any kind of ECDH handler, allowing the actual private key to be stored into a TPM or a HSM.\n\n## Bottle\n\nBottles are containers for arbitrary data (json, cbor, anything) that can be used to add any number of signatures, encryption layers etc to the underlying message, while\nkeeping recovery of the original message fairly easy.\n\n```go\n// Create a new bottle with a message inside\nbottle := cryptutil.NewBottle([]byte(\"s.o.s. to the world\"))\n\n// encrypt for Alice OR Bob (either will be able to open the bottle)\nbottle.Encrypt(rand.Reader, bob.Public(), alice.Public())\nbottle.BottleUp() // bottle in a bottle, so that the signature includes the encryption\nbottle.Sign(rand.Reader, alice) // sign from Alice\n\n// Bob is opening the bottle\nopener, err := cryptutil.NewOpener(bob)\nres, info, err := opener.Open(bottle)\n// first, check err to see if opening the bottle was successful\n// Then you can inspect info to see which signatures were verified, and how many\n// layers of encryption were decrypted\n```\n\n## ID Card\n\nID Cards can be used by entities with a signing key to provide alternate encryption keys.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarpeleslab%2Fcryptutil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarpeleslab%2Fcryptutil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarpeleslab%2Fcryptutil/lists"}