Python script
Below is the Python script that will be used to:- Generate a random AES-256 key
- Hash the tenant secret
- Wrap the AES-256 key with the Salesforce 4096 key
- HSM_IP: The IP of the HSM that the device running the script will be able to reach the HSM
Python
Upload AES-256 random key to Vectera Plus
Download the script above and run it.It will first ask how many key parts you would like to generate.The amount of components outputted will depend on the number of key parts chosen.
For example, the output below contains 4 components because key parts value was 1:
None
For “Key Parts:”, select the same number you entered for the Python script.For “Major key to be used:”, select
PMKFor “Modifier/Header:”, select 2 DEKFor “Key Type/Length:”, select AES 256For “Key Usage”, select Encrypt & DecryptEnter a key label.Select preferred security usages.Select Next >Enter the components based on the output from the Python script.Select Select
ImportantTo avoid the plaintext components of the key being copied to memory on the device, copy the components text by hand instead of using copy and paste.
Next > and Next > againNoteMake sure that the “Checksum: Standard:” value matches Python’s output KCV value.
FinishAttain the hash tenant secret and encrypted tenant secret files
After uploading the AES-256 key to the HSM, go back to the Python script.In the directory which the Python script is located, the
hash_tenant_secret.b64 will be produced.The script will then ask to input the slot number of where the AES-256 key is located that was uploaded in the previous steps.

