{"id":16410164,"url":"https://github.com/stereobutter/aes-gcm-rsa-oaep","last_synced_at":"2026-06-25T12:31:01.532Z","repository":{"id":107234320,"uuid":"533883030","full_name":"stereobutter/aes-gcm-rsa-oaep","owner":"stereobutter","description":"Kubeseal aes-gcm-rsa-oaep encryption implemented in python","archived":false,"fork":false,"pushed_at":"2024-03-04T13:46:42.000Z","size":27,"stargazers_count":2,"open_issues_count":7,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T23:45:50.759Z","etag":null,"topics":["devops","kubeseal","sealed-secrets"],"latest_commit_sha":null,"homepage":"","language":"Python","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/stereobutter.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,"zenodo":null}},"created_at":"2022-09-07T18:06:26.000Z","updated_at":"2022-12-29T09:32:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"b6ef9801-1fed-4e81-938b-d8483746ccb0","html_url":"https://github.com/stereobutter/aes-gcm-rsa-oaep","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/stereobutter/aes-gcm-rsa-oaep","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stereobutter%2Faes-gcm-rsa-oaep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stereobutter%2Faes-gcm-rsa-oaep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stereobutter%2Faes-gcm-rsa-oaep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stereobutter%2Faes-gcm-rsa-oaep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stereobutter","download_url":"https://codeload.github.com/stereobutter/aes-gcm-rsa-oaep/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stereobutter%2Faes-gcm-rsa-oaep/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34775927,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-25T02:00:05.521Z","response_time":101,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["devops","kubeseal","sealed-secrets"],"created_at":"2024-10-11T06:23:22.122Z","updated_at":"2026-06-25T12:31:01.523Z","avatar_url":"https://github.com/stereobutter.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AES-GCM + RSA OAEP encryption (as used by kubeseal)\n\n## Installation\n\n```\npip install aes-gcm-rsa-oaep\n```\n\n\u003e :blue_book: This module depends on the `cryptography`(https://pypi.org/project/cryptography/) module. See [here](https://cryptography.io/en/latest/installation/#building-cryptography-on-linux) for instructions on how to install or build `cryptography` your platform. \n\n## Usage\n```python\nfrom cryptography.hazmat.primitives.asymmetric.rsa import generate_private_key\nfrom aes_gcm_rsa_oaep import encrypt, decrypt\n\nprivate_key = generate_private_key(public_exponent=65537, key_size=4096)\npublic_key = private_key.public_key()\n\nplaintext = b'hello world'\nlabel='my-namespace/my-secret'\n\nciphertext = encrypt(plaintext, public_key, label)\n\nassert plaintext == decrypt(ciphertext, private_key, label)\n```\n\n## Encryption Algorithm\nThe implementation follows and is compatible with https://github.com/bitnami-labs/sealed-secrets/blob/main/docs/developer/crypto.md\n\nEncrypting a plaintext works as follows:\n* a 256 bit random session key is generated\n* AES-GCM is used to encrypt the plaintext using the session key\n* the session key is encrypted using a provideded RSA public key\n* the resulting payload is the concatenated RSA ciphertext length (2 bytes), the RSA encrypted session key and the AES encrypted plaintext \n\nDecrypting a ciphertext works by following the procedure in reverse\n* extraction of the RSA ciphertext length, RSA encrypted session key and the AES encrypted plaintext\n* the session key is decrypted using the RSA private key\n* the session key is used to decrypt the AES encrypted plaintext ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstereobutter%2Faes-gcm-rsa-oaep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstereobutter%2Faes-gcm-rsa-oaep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstereobutter%2Faes-gcm-rsa-oaep/lists"}