wultra / powerauth-crypto

PowerAuth - Open-source solution for authentication, secure data storage and transport security in mobile banking.
https://www.wultra.com/product/wultra-mobile-security-suite/
Apache License 2.0
56 stars 22 forks source link

Add support for server-side ephemeral keys #298

Open petrdvorak opened 5 years ago

petrdvorak commented 5 years ago

Currently, we use an ECIES algorithm with fixed keys (master server public key, device public key) that are stored on the mobile device and client-side ephemeral keys. This is good, but we could also add support for the server-side ephemeral keys (let's call them "temporary keys" here).

Gist

Temporary Public Key Exchange

=> Client now has a new one-time public key

Temporary Key Pair Storage on Server-Side

Server (probably PA Server) should store temporary keys in a separate table, such as pa_temporary_keypair. Each record should be one-time-only (when used, it should invalidate) and should have short expiration (to allow the cleanup).

Encrypting Request and Response

The encryption/decryption works the same way as for our current ECIES. The temporary key should be invalidated once the encrypt/decrypt cycle is completed.

romanstrobl commented 4 years ago

I suggest we look at ECDHE_ECDSA in RFC 4492: https://tools.ietf.org/html/rfc4492, the TLS 1.2 specification defines a similar protocol for authentication of a public key.

romanstrobl commented 4 years ago

In particular, section 5.4 defines the data being signed by ECDSA: image

petrdvorak commented 11 months ago

To add one more comment to this topic. The improvement will provide us with: