Title: Use symmetric crypto for github_token · Issue #7 · google/magic-github-proxy · GitHub
Open Graph Title: Use symmetric crypto for github_token · Issue #7 · google/magic-github-proxy
X Title: Use symmetric crypto for github_token · Issue #7 · google/magic-github-proxy
Description: Thanks for a nice writeup! You suggest using asymmetric encryption for encrypting the real token and signing the JWT. This works well; however, we never use the private/public keys on different machines, so we could go for symmetric cryp...
Open Graph Description: Thanks for a nice writeup! You suggest using asymmetric encryption for encrypting the real token and signing the JWT. This works well; however, we never use the private/public keys on different mac...
X Description: Thanks for a nice writeup! You suggest using asymmetric encryption for encrypting the real token and signing the JWT. This works well; however, we never use the private/public keys on different mac...
Opengraph URL: https://github.com/google/magic-github-proxy/issues/7
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Use symmetric crypto for github_token","articleBody":"Thanks for a [nice writeup][1]! You suggest using asymmetric encryption for encrypting the real token and signing the JWT. This works well; however, we never use the private/public keys on different machines, so we could go for symmetric crypto instead. This would make the resulting token shorter (probably because [RSA needs padding][2] but there might be some other stuff I don't know about):\r\n\r\n```shell\r\n$ echo \"${REAL_TOKEN}\"\r\n7e096a6633471a2c967718d4b435f0ecdac5c426\r\n\r\n$ echo \"${REAL_TOKEN}\" | openssl rsautl -encrypt -inkey public.pem -pubin | wc -c\r\n256\r\n\r\n$ echo \"${REAL_TOKEN}\" | openssl rsautl -encrypt -inkey public.pem -pubin | base64\r\nTmqTx2ri6FC1ybGdVKiKQQHb3+Ns/iDJ7MfaXPswDfXA0Nhtqu4lxWv+ZDP209cPFXk8zOCIVttH\r\nGMV8Sj8/+bBjPQqXWoA8KZugxzivgMoEgBGhGRFC51b0X2aj/aA2T0D19d1L3YRjN+WpuVx5IXD+\r\njTrBFu53YZRq6igHlQtcG2Z115N9TE+o4vwEts0UXslc6LnbEXmPo+xo2Hg68I4P6USdt/ES/Xqn\r\ndJodhz6nS9wSe2YxuZ5tRm8jrSLqBn/uiyTh7U8K7jQlqRYqsdbK3WtPDLJmchyOiOeCp5rZ0Pcp\r\nris2W1wVKDIBRmF5ZdEBPxRh/aF/LCV6gacNKw==\r\n\r\n$ echo \"${REAL_TOKEN}\" | openssl aes-256-cbc -salt -kfile private.pem -iter 1 | wc -c\r\n64\r\n\r\n# The key can also be derived from a string (i. e. `app.secret` for Flask)\r\n# – easier to manage\r\n$ echo \"${REAL_TOKEN}\" | openssl aes-256-cbc -salt -k \"hello\" -iter 1 | base64\r\nU2FsdGVkX18Za6G3LLM2Djs+Qj+Z4o/0R83IVVizzJfQp8eEbhYfdgmtpi3qItW5YmMUZ8NaKe0Q\r\nbH6Hvs2sKQ==\r\n```\r\n\r\nWhat do you think? :)\r\n\r\n[1]: https://blog.thea.codes/building-a-stateless-api-proxy/\r\n[2]: https://en.wikipedia.org/wiki/RSA_(cryptosystem)#Padding","author":{"url":"https://github.com/notpushkin","@type":"Person","name":"notpushkin"},"datePublished":"2019-05-30T10:28:07.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/7/magic-github-proxy/issues/7"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ce9ea56e-5e6a-e3fe-f169-c6b39ef99cfa |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D374:1FC98B:14323A9:1AFFBF1:6A5B9B04 |
| html-safe-nonce | f61816d1d0408c1fb0ae9cacf7db127ea479abe92f309563c9e884068831e1f0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMzc0OjFGQzk4QjoxNDMyM0E5OjFBRkZCRjE6NkE1QjlCMDQiLCJ2aXNpdG9yX2lkIjoiODU5NTk0NjMyODIyODA3NjI5MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ce7c1ce6e5500d870578c2f6c35f4f70cead34098c49482ef72e9f4954e7799f |
| hovercard-subject-tag | issue:450238183 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/google/magic-github-proxy/7/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9679887d90f2d6ab9eb4aa80ac56b761dc90bf2b387b855013af2783ca3e41d1/google/magic-github-proxy/issues/7 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9679887d90f2d6ab9eb4aa80ac56b761dc90bf2b387b855013af2783ca3e41d1/google/magic-github-proxy/issues/7 |
| og:image:alt | Thanks for a nice writeup! You suggest using asymmetric encryption for encrypting the real token and signing the JWT. This works well; however, we never use the private/public keys on different mac... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | notpushkin |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| go-import | github.com/google/magic-github-proxy git https://github.com/google/magic-github-proxy.git |
| octolytics-dimension-user_id | 1342004 |
| octolytics-dimension-user_login | |
| octolytics-dimension-repository_id | 159738931 |
| octolytics-dimension-repository_nwo | google/magic-github-proxy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 159738931 |
| octolytics-dimension-repository_network_root_nwo | google/magic-github-proxy |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width