ctmultitoken

The ctmultitoken utility is a simple demonstration tool that allows you to perform basic cryptographic functions on a ProtectServer HSM. It allows you to specify an operation, and one or more tokens on which to perform that operation. The ctmultitoken utility runs the operations and returns a summary of the results.

Syntax

ctmultitoken -mode <mode> {-slots <slot_list> | -nslots <slot_threads>} [options...]

Argument(s) Shortcut Description
-alarm <secs> -al Sound periodic alarm (every <secs> seconds) if error occurs.
-blob <blob_count> -b Number of data blobs to be signed during each multisign operation.
-curve <curve_num> -crv ID number of ECC curve. If user-defined (99), then must specify -parmfile.
-eciesdata <filename> -ecd

Specifies the file to receive the plaintext data used.

-eciesenc <filename> -ece

Specifies the file to receive the encrypted data.

-ecieskey <filename> -eck

Specifies the file to receive the DER-encoded private key.

-enddate <YYYYMMDD> -end Validity end date for key, in YYYYMMDD format.
-force -f Avoid prompts for responses.
-gcmaad <bytes> -gad Specify the length of the AAD data used for GCM/GMAC. The AAD data can not be larger than 1024 bytes.
-gcmiv <bits> -giv

Specify the length of the IV (in bits) to be used for GCM/GMAC.

Valid values: 0,96,128

-help -h Display help information and operating modes only.
-kdfchoice <kdf_index> -kdf Select key derivation function - specify choice list index.
-kdfscnt <counter_index> -kds Select key derivation session counter type - specify choice list index.
-key <key_size> -k Size of key: asymmetric in bits (default = 1024 for RSA, 2048 for DSA). Symmetric in bytes (i.e. 16, 24, 32 for AES/ARIA).
-keychoice <key_index> -kc Select key type to derive/generate - specify choice list index.
-keyderiv <keysize> -kde Size of key to derive with (ex. 1024 for X9.42 Diffie Hellman).
-kwicv -kiv Use external ICV for the key wrap mechanism.
-logfile <filename> -l File for results logging.
-mode <mode> -m Operating mode. See Operating Modes.
-multipartsig -msig Use multipart signatures.
-nodec -nod Decryption operation will not be performed. Only symmetric and asymmetric encryption will be performed and measured.
-nodestroy -n Leaves created objects on the HSM after test completes.
-noenc -noe Perform only one encryption operation. Only symmetric and asymmetric decryption will be performed and measured.
-nosign -nos Perform only one sign operation. Only verify will be performed and measured.
-nounwrap -nou Unwrapping operation will not be performed. Only wrapping will be performed and measured.
-noverify -nov Verify operation will not be performed. Only sign will be performed and measured.
-noverifyr -nvr Do not verify decryption results.
-nowrap -now Perform only one wrapping operation. Only unwrapping will be performed and measured.
-nslots <slot_threads> -ns

Create multiple threads on the same slot(s). Specify <slot>x<number of threads>, with multiple slots separated by commas. The example below creates 5 threads on slot 1 and 20 threads on slot 2:

Example: -nslots 1x5,2x20

You must specify either this option or -slots. See -slots <slots>.

-packet <packet_size> -p Size of packet used in operation.
-parmfile <param_file> -prm File for EC curve parameters or OAEP source data (0 = none for OAEP).
-password <password> -pwd Specify password to use for token.
-pbkd2prf   Specify the type of PRF to use for PBKD2-based key derivation.
-prftype <type> -prf Specify the type of PRF to use for PRF-based key derivation.
-sharefile <filename> -shf Shared data file used for operation.
-silent -sil Disables system "beep" that is generated when a error occurs.
-slots <slots> -s

List of slots to use (slot numbers separated by commas). List the same slot multiple times to create multiple threads on that slot. The example below creates 2 threads on slot 1 and 3 threads on slot 2:

Example: -slots 1,1,2,2,2

To create many threads on the same slot, use -nslots instead. See -nslots <slot_threads>.

NOTE   Multithreaded requests cannot be sent if ctmultitoken is being used in Software-only mode.

-startdate <YYYYMMDD> -sta Validity start date for key in format <YYYYMMDD>.
-subprime <size> -sub Size of the subprime in bits.
-symm <mechanism> -sym Select symmetric key mechanism for symderive/pbegen or key choice for symgen (can also use -keychoice).
-template -tp Attaches a generic unwrap template or derive template for the wrapunwrap or symderive mode respectively.
-timed <secs> -t Fixed amount of time to run (seconds).
-usage <uses> -u Number of times a key is allowed to be used.
-verbose -v Show all thread performances. Default is only first and last threads.

Operating Modes

The following table lists the available operating modes for the ctmultitoken utility. The operating mode is specified using the -mode parameter.

Mode Description
aescmac AES CMAC sign
aesenc AES ECB encrypt
aesenccbc AES CBC encrypt
aesencgcm AES GCM encrypt
aesenckw AES KW encrypt
aesencofb AES OFB encrypt
aesmac AES MAC sign
aeswrapkw AES KW wrap
aeswrapkwp AES KWP wrap
ariaenc ARIA ECB encrypt
ariaenccbc ARIA CBC encrypt
ariamac ARIA MAC sign
bip32childderive BIP32 Child Key derive
bip32masterderive BIP32 Master Key derive
des3encofb DES3 OFB encrypt
descmac DES3 CMAC sign
desenc DES3 ECB encrypt
desenccbc DES3 CBC encrypt
desmac DES3 MAC sign
desx919mac DES3 X919 MAC sign
dsakeygen DSA Key Generation
dsasigver DSA bare sign
ecdhderive ECDH derive key
ecdsagbcssha256sigver SHA256 ECDSA-GBCS sign
ecdsakeygen ECDSA Key Generation
ecdsasha1sigver SHA1 ECDSA sign
ecdsasha224sigver SHA224 ECDSA sign
ecdsasha256sigver SHA256 ECDSA sign
ecdsasha384sigver SHA384 ECDSA sign
ecdsasha512sigver SHA512 ECDSA sign
ecdsasha3-224-sigver SHA3-224 ECDSA sign
ecdsasha3-256sigver SHA3-256 ECDSA sign
ecdsasha3-384sigver SHA3-384 ECDSA sign
ecdsasha3-512sigver SHA3-512 ECDSA sign
ecdsasigver ECDSA sign
ecedwardskeygen EC Edwards Key Generation
eciesshimxorhmacsha1 ECIES XOR with HMAC SHA1 decrypt
eciesshimxorhmacsha1shared ECIES XOR with HMAC SHA1 and shared data decrypt
eciesxorhmacsha1 ECIES XOR enc/dec with HMAC SHA1 
eciesxorhmacsha1shared ECIES XOR enc/dec with HMAC SHA1 and shared data 
eddsakeygen EdDSA Key Generation
eddsasha1sigver SHA1 EDDSA sign
eddsasha224sigver SHA224 EDDSA sign
eddsasha256sigver SHA256 EDDSA sign
eddsasha384sigver SHA384 EDDSA sign
eddsasha512sigver SHA512 EDDSA sign
eddsasha3-224sigver SHA3-224 EdDSA sign
eddsasha3-256sigver SHA3-256 EdDSA sign
eddsasha3-384sigver SHA3-384 EdDSA sign
eddsasha3-512sigver SHA3-512 EdDSA sign
eddsasigver EDDSA sign
keccak-1600 KECCAK-1600
md5 MD5 Hashing
milenage MILENAGE sign
pbegen PBE key generation
randgen Random number generation
rc4enc RC4 encrypt
rsa1863primekeygen RSA FIPS 186-3 using Primes key generation
rsaenc RSA encrypt
rsakeygen RSA key generation
rsaoaepenc RSA OAEP encrypt
rsasigver RSA sign
rsax931keygen RSA X9.31 key generation
seedenc SEED ECB encrypt
seedenccbc SEED CBC encrypt
seedmac SEED MAC sign
sha1 SHA-1 Hashing
sha1dsasigver SHA1 DSA sign
sha1hmac SHA1 HMAC sign
sha1rsapsssigver SHA1 RSA PSS sign
sha1rsasigver SHA1 with RSA sign
sha224 SHA-224 Hashing
sha224dsasigver SHA224 DSA sign
sha224hmac SHA224 HMAC sign
sha224rsaoaepenc SHA224 RSA OAEP encrypt
sha224rsapsssigver SHA224 RSA PSS sign
sha224rsasigver SHA224 with RSA sign
sha256 SHA-256 Hashing
sha256dsasigver SHA256 DSA sign
sha256hmac SHA256 HMAC sign
sha256rsaoaepenc SHA256 RSA OAEP encrypt
sha256rsapsssigver SHA256 RSA PSS sign
sha256rsasigver SHA256 with RSA sign
sha384 SHA-384 Hashing
sha384dsasigver SHA384 DSA sign
sha384hmac SHA384 HMAC sign
sha384rsaoaepenc SHA384 RSA OAEP encrypt
sha384rsapsssigver SHA384 RSA PSS sign
sha384rsasigver SHA384 with RSA sign
sha512 SHA-512 Hashing
sha512dsasigver SHA512 DSA sign
sha512hmac SHA512 HMAC sign
sha512rsaoaepenc SHA512 RSA OAEP encrypt
sha512rsapsssigver SHA512 RSA PSS sign
sha512rsasigver SHA512 with RSA sign
sha3-224 SHA3-224 Hashing
sha3-256 SHA3-256 Hashing
sha3-384 SHA3-384 Hashing
sha3-512 SHA3-512 Hashing
symderive Symmetric key derivation
symgen Symmetric key generation
tuak TUAK sign
wrapunwrap Wrap/unwrap operations
x942dhderive X9.42 DH Derive
x942dhkeygen X9.42 DH Key Pair Generation
x942dhparamsgen X9.42 DH Domain Parameter Generation

Notes

1.If you are performing RSA operations, you have the option of specifying a key size (512, 1024, 2048, 4096, 8192). If no key size is specified, the default key size of 1024 will be used. For example:

ctmultitoken -mode rsasigver -key 512 -slots 1

2.If you are performing wrapunwrap operation, it will perform the following operations:

Generate RSA key pair and a symmetric DES key.

Wrap DES key with RSA public key.

Unwrap wrapped key above with RSA private key.

Verify the unwrapped key.

3.A thread will be spawned to perform tests on each slot specified. A slot can be specified multiple times, in which case multiple threads will be created for the slot.

4.Options for the following modes can be used with the default 1024 bit key size only:

sha256rsasign - SHA256 with RSA

sha384rsasign - SHA384 with RSA

sha512rsasign - SHA512 with RSA

If you specify a keysize on the command line (any of 1024, 2048 or 4096), the result is the 1024 bit benchmark speed, and a file called "1024" or "2048" or "4096" is created - that is the keysize parameter is parsed as a filename to which results are saved.

5.To run ctmultitoken in symderive mode, you must first turn on the Weak PKCS#11 Mechanisms flag (see Weak PKCS#11 Mechanisms).

Named and User-Defined Curves

ProtectServer HSMs employ named and user-defined curves. ctmultitoken supports this option, as illustrated in the following example:

./ctmultitoken -mode ecdsasigver -s 1,1,1,1,1,1,1,1


Prime field curves:

    [0]secp224k1  [1]secp224r1(P-224)  [2]secp256k1  [3]secp384r1(P-384)
    [4]secp521r1(P-521)

X9.62 prime curves

    [5]X9_62_prime192v1(P-192)  [6]X9_62_prime256v1(P-256)

X9.62 two field curves:

    [7]X9_62_c2tnb191v1e  [8]X9_62_c2tnb191v1

Brainpool Curves:

    [9]brainpoolP160r1  [10]brainpoolP160t1 [11]brainpoolP192r1
    [12]brainpoolP192t1 [13]brainpoolP224r1 [14]brainpoolP224t1
    [15]brainpoolP256r1 [16]brainpoolP256t1 [17]brainpoolP320r1
    [18]brainpoolP320t1 [19]brainpoolP384r1 [20]brainpoolP384t1
    [21]brainpoolP512r1 [22]brainpoolP512t1

Montgomery curves:

    [23]curve25519

Please pick a curve (0-23):

Here, you would provide the filepath to the file specifying the Elliptical Curve parameters. The format and content of the parameter file follow industry standards. See Sample EC Domain Parameter Files for some examples.