The code seems to be just calling createprimary:
Which means that call will need owner auth on the encrypt and decrypt calls to create the primary key.
The TCG PC Provisioning Guidlines [1] discuss that an SRK should be established and made persistent at address 0x81000001. The SRK has no password and can be used a space for everyone to store their keys under without needing owner auth. The script should probably check for the SRK and use that over creating a primary object, and optionally create the SRK and persist it and then use that.
[1] https://trustedcomputinggroup.org/wp-content/uploads/TCG-TPM-v2.0-Provisioning-Guidance-Published-v1r1.pdf
The code seems to be just calling createprimary:
Which means that call will need owner auth on the encrypt and decrypt calls to create the primary key.
The TCG PC Provisioning Guidlines [1] discuss that an SRK should be established and made persistent at address 0x81000001. The SRK has no password and can be used a space for everyone to store their keys under without needing owner auth. The script should probably check for the SRK and use that over creating a primary object, and optionally create the SRK and persist it and then use that.
[1] https://trustedcomputinggroup.org/wp-content/uploads/TCG-TPM-v2.0-Provisioning-Guidance-Published-v1r1.pdf