{"id":34063948,"url":"https://github.com/yoyowallet/google-pay-token-decryption","last_synced_at":"2026-04-07T15:32:15.191Z","repository":{"id":57435361,"uuid":"388770610","full_name":"yoyowallet/google-pay-token-decryption","owner":"yoyowallet","description":"A Python package to decrypt Google Pay tokens.","archived":false,"fork":false,"pushed_at":"2021-08-12T14:37:43.000Z","size":34,"stargazers_count":14,"open_issues_count":2,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-03-23T01:45:02.998Z","etag":null,"topics":["google-pay","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","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/yoyowallet.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-23T10:55:17.000Z","updated_at":"2025-12-08T11:44:12.000Z","dependencies_parsed_at":"2022-09-19T08:10:25.352Z","dependency_job_id":null,"html_url":"https://github.com/yoyowallet/google-pay-token-decryption","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/yoyowallet/google-pay-token-decryption","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoyowallet%2Fgoogle-pay-token-decryption","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoyowallet%2Fgoogle-pay-token-decryption/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoyowallet%2Fgoogle-pay-token-decryption/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoyowallet%2Fgoogle-pay-token-decryption/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yoyowallet","download_url":"https://codeload.github.com/yoyowallet/google-pay-token-decryption/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoyowallet%2Fgoogle-pay-token-decryption/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31518506,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["google-pay","python","python3"],"created_at":"2025-12-14T05:56:53.940Z","updated_at":"2026-04-07T15:32:15.186Z","avatar_url":"https://github.com/yoyowallet.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google Pay token decryption\n\nA Python package to decrypt Google Pay tokens according to the [Google Pay docs](https://developers.google.com/pay/api/android/guides/resources/payment-data-cryptography#decrypt-token) using the [`pyca/cryptography`](https://cryptography.io/en/latest/) package.\n\n## System requirements\n\n- Python 3.8+\n\n## Usage\n\n1. Install the package using Pip: `pip install google-pay-token-decryption`.\n\n2. Get latest Google root signing keys [here](https://developers.google.com/pay/api/android/guides/resources/payment-data-cryptography#root-signing-keys).\n\n3. Get your **merchant ID/recipient ID** from the [Google Pay business console](https://pay.google.com/business/console). It should be in the format \"merchant:\u003cyour merchant ID\u003e\". In Google's test environment it is always \"merchant:12345678901234567890\".\n\n4. Generate your merchant private and public keys by following [this documentation](https://developers.google.com/pay/api/android/guides/resources/payment-data-cryptography#using-openssl).\n\n5. Create a new `GooglePayTokenDecryptor` object and decrypt a token using the `decrypt_token` method:\n\n```python\nfrom google_pay_token_decryption import GooglePayTokenDecryptor\n\n# Instantiate using the a list of root signing keys, your recipient ID and private key\nroot_signing_keys = [{\n    \"keyValue\": \"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE/1+3HBVSbdv+j7NaArdgMyoSAM43yRydzqdg1TxodSzA96Dj4Mc1EiKroxxunavVIvdxGnJeFViTzFvzFRxyCw==\",\n    \"keyExpiration\": \"32506264800000\",\n    \"protocolVersion\": \"ECv2\",\n}]\nrecipient_id = \"someRecipient\"\nprivate_key = \"MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgCPSuFr4iSIaQprjjchHPyDu2NXFe0vDBoTpPkYaK9dehRANCAATnaFz/vQKuO90pxsINyVNWojabHfbx9qIJ6uD7Q7ZSxmtyo/Ez3/o2kDT8g0pIdyVIYktCsq65VoQIDWSh2Bdm\"\ndecryptor = GooglePayTokenDecryptor(root_signing_keys, recipient_id, private_key)\n\n# Verify and decrypt a token \nencrypted_token = {\n    \"signature\": \"MEYCIQCbtFh9UIf1Ty3NKZ2z0ZmL0SHwR30uiRGuRXk9ghpyrwIhANiZQ0Df6noxkQ6M652PcIPkk2m1PQhqiq4UhzvPQOYf\",\n    \"intermediateSigningKey\": {\n        \"signedKey\": \"{\\\"keyValue\\\":\\\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE/1+3HBVSbdv+j7NaArdgMyoSAM43yRydzqdg1TxodSzA96Dj4Mc1EiKroxxunavVIvdxGnJeFViTzFvzFRxyCw==\\\",\\\"keyExpiration\\\":\\\"1879409613939\\\"}\",\n        \"signatures\": [\n            \"MEQCIFBle+JsfsovRBeoFEYKWFAeBYFAhq0S+GtusiosjV4lAiAGcK9qfVpnqG6Hw8cbGBQ79beiAs6IIkBxBfeKDBR+kA==\"\n        ]\n    },\n    \"protocolVersion\": \"ECv2\",\n    \"signedMessage\": \"{\\\"encryptedMessage\\\":\\\"PeYi+ZnJs1Gei1dSOkItdfFG8Y81FvEI7dHE0sSrSU6OPnndftV/qDbbmXHmppoyP/2lhF+XsH93qzD3u46BRnxxPtetzGT0533rIraskTj8SZ6FVYY1Opfo7FECGk57FfF8aDaCSOoyTh1k0v6wdxVwEVvWqG1T/ij+u2KWOw5G1WSB/RVicni0Az13ModYb0KMdMws1USKlWxBfKU5PtxibVx4fZ95HYQ82qgHlV4ToKaUY7YWud1iEspmFsBMk0nh4t1hVxRzsxKUjMV1915qD5yq7k5n9YPao2mR9NJgLPDktsc4uf9bszzvnqhz3T1YID43QwX16yCyn/YxNVe3dJ1+S+BGyJ+vyKXp+Zh4SlIua2NFLwnR06Es3Kvl6LlOGasoPC/tMAWYLQlGsl+vHK3mrMZjC6KbOsXg+2mrlZwL+QOt3ih2jIPe\\\",\\\"ephemeralPublicKey\\\":\\\"BD6pQKpy7yDebAX4qV0u/AfMYNQhOD+teyoa/5SsxwTGCoC1ZKHxNMb5BXvRmBcYGPNTx8+fAkEwzJ8GqbX/Q7E=\\\",\\\"tag\\\":\\\"8gFteCvCuamX1RmL7ORdHqleyBf0N55OfAs80RYGgwc=\\\"}\"\n}\ndecrypted_token = decryptor.decrypt_token(encrypted_token)\nprint(decrypted_token)\n\"\"\"\n{\n    \"messageExpiration\": \"32506264800000\",\n    \"messageId\": \"AH2EjtfkY514K5lmPF4NOP9lMR5tPedsjQR719hIzI-zB1g0A-TBlYInGQuEVQeIWGlajqEpvSyrl3r_iN0RxoV9RYjxqnzG-kXmcBNkferp4NfNjVqxYrVT0e5JRzU3dQjkb0tQWOxN\",\n    \"paymentMethod\": \"CARD\",\n    \"paymentMethodDetails\": {\n        \"expirationYear\": 2026,\n        \"expirationMonth\": 12,\n        \"pan\": \"4111111111111111\",\n        \"authMethod\": \"PAN_ONLY\"\n    }\n}\n\"\"\"\n```\n\n## Contributing\n\nSee [Contributing](./CONTRIBUTING.md)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoyowallet%2Fgoogle-pay-token-decryption","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoyowallet%2Fgoogle-pay-token-decryption","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoyowallet%2Fgoogle-pay-token-decryption/lists"}