In this key exchange scheme for a public key infrastructure, the initialization step or “personalization” is based on the secure exchange of addressable cryptographic tables between the communicating parties. The content of these tables is generated either with ternary random numbers, or with arrays of addressable physical unclonable functions having ternary states, which we are generating with memristors. Private keys are generated independently with the shared public keys by all communicating parties, with their ternary cryptographic tables. Public and private key pairs, which are used for authentication and cryptography, are binary streams while the core of the scheme is based on ternary logic. The communication between parties can occur over untrusted channels, by exchanging dynamically generated public keys, and using legacy binary codes. The ternary computing environment largely enhances entropy, and creates additional levels of cybersecurity.