0

I would like to implement PGP with PHP. I have seen services like Google reCaptcha or Stripe where they give the user two keys, the public one and secret one. The first one encrypts the comunication between your JS (which is visible to the public) and their API endpoint when you want to get a token based on what the user has written. And later, the second one encrypts the comunication between code and their API endpoint to check that the token is licit.

reCaptcha's key is 40 characters length and Stripe's key is 24 characters length.

key length example

How do they do it? Because if I use openssl PHP functions, I get very very long keys, and same expectations with GnuPG.

Thanks a lot, - Albin

Albin
  • 197
  • 2
  • 11
  • The text is blurred by we can still read the characters, please throw these keys and generate new keys. – A.L Oct 09 '18 at 08:53
  • 1
    What are you proposing exactly? Using the PGP executables from within PHP? Using existing PHP cryptographic functions to replicate the PGP functionality? Implementing PGP's encryption algorithms from scratch in PHP? Something else? What have you attempted so far? What problems have you run into? As is I'm afraid this question is too broad to answer. – GordonM Oct 09 '18 at 09:16
  • No, I don´t want to do a PGP implementation from scratch. I prefer to use a PHP library instead of executables from PHP but overall I want to be able to use PGP. I have attemped openssl and gnupg libraries but they use very long keys. My problem is that I want something as simple as reCaptcha, where my user (other developer) only have to copy two short ASCII keys, not 1024 binary bits. – Albin Oct 09 '18 at 10:10

0 Answers0