Refactor cryptography for PGP and GCS credentials