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
1
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
2
On the Excrypt Manager, select
Key Management, and under “Key Table” select Edit Key Storage3
Go to an available key slot and select
Insert Key4
Select
Symmetric Key Wizard and select OK5
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 >6
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
1
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.2
The script will ask to input the slot number of where the Salesforce public key is located.
3
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.
4
The Python script will finish and output the wrapped tenant secret to
encrypted_tenant_secret.b64
