14. Homogeneous keys pair vs Heterogeneous key pair - Ayushi-srivastav/OCI GitHub Wiki

Homogeneous Key Pair in OCI


A homogeneous key pair means both keys (public and private) are of the same type and are used together in the same way. They are like a matching set.

Example:

  • RSA Key Pair: Both keys are created using the RSA algorithm.
  • Public Key: Used to encrypt data or verify a signature.
  • Private Key: Used to decrypt data or create a signature.

In OCI, you might create an RSA key pair in the OCI Vault. Both keys are RSA keys and work together for encryption and decryption or signing and verifying.

Heterogeneous Key Pair in OCI


A heterogeneous key pair means the keys are of different types or used for different purposes. They are like a mixed set.

Example:

  • RSA Key for Encryption: An RSA key pair is used to encrypt and decrypt data.
  • Public Key: Encrypts data.
  • Private Key: Decrypts data.
  • ECDSA Key for Signing: An ECDSA key pair is used to sign and verify data.
  • Private Key: Signs data.
  • Public Key: Verifies the signature.

In OCI, you might use an RSA key pair to securely exchange a secret key and an ECDSA key pair to sign data to ensure it hasn't been tampered with.

Practical Examples in OCI

Homogeneous Key Pair Example:

  1. Creating an RSA Key Pair in OCI Vault:

    • Go to the OCI Console.
    • Navigate to "Identity & Security" > "Vault" > "Keys".
    • Create a new key and choose RSA.
    • You get a matching set of RSA keys (public and private).
  2. Using the Key Pair:

    • Use the RSA public key to encrypt data.
    • Use the RSA private key to decrypt the data.

Heterogeneous Key Pair Example:

  1. Using Different Keys for Different Purposes:
    • Create an RSA key pair for encrypting data.
    • Create an ECDSA key pair for signing data.
    • Use the RSA public key to encrypt data before storing it.
    • Use the ECDSA private key to sign data before sending it.

Summary

  • Homogeneous Key Pair: Both keys are the same type (e.g., RSA). They work together for the same purpose.
  • Heterogeneous Key Pair: The keys are different types (e.g., RSA for encryption, ECDSA for signing). They are used for different purposes.