a Secarta project ...

HTTPsec Authentication Protocol


Preamble

4.7. auth

The auth directive in an initialization response allows the responder to send an encrypted random value to the requester. This acts as an authentication challenge to the requester. The random value auth-secretis encrypted in the requester's public key, yet features unencrypted in the shared secret which must be identically known to both parties for the authentication success of subsequent continuation messages. The requester is thus challenged to posses the correct private key to decrypt the value of the auth directive.

The auth directive is computed as follows:

auth = base64enc( ENC( public-key, auth-secret ) )

where the following apply:

  • base64enc() is base64 encoding, bytes to string.
  • ENC( k, pt ) is encryption according to the Encryption Scheme in public key k of plaintext pt.
  • public-key is the public key associated (subjectively, by the responder) with the requester.
  • auth-secret is 256 bit cryptographic-quality random value generated by the responder, which MUST be generated afresh by the responder for each new initialization.

The requester decrypts the auth directive to retrieve the auth-secret value as follows:

auth-secret = DEC( private-key, base64dec( auth ) )

where the following apply:

  • base64dec() is base64 decoding, string to bytes.
  • DEC( k, ct ) is decryption according to the Encryption Scheme with private key k of ciphertext value ct.
  • private-key is the requester's private key.
  • auth-secret is 256 bit random value.