본문 바로가기
카테고리 없음

SmartCard HSM-DUAL

by Joseph.Lee 2019. 8. 8.
C:\Program Files\OpenSC Project\OpenSC\tools>pkcs11-tool.exe --list-mechanisms
Using slot 0 with a present token (0x0)
Supported mechanisms:
  SHA-1, digest
  SHA256, digest
  SHA384, digest
  SHA512, digest
  MD5, digest
  RIPEMD160, digest
  GOSTR3411, digest
  ECDSA, keySize={192,521}, hw, sign, other flags=0x1d00000
  ECDSA-SHA1, keySize={192,521}, hw, sign, other flags=0x1d00000
  ECDH1-COFACTOR-DERIVE, keySize={192,521}, hw, derive, other flags=0x1d00000
  ECDH1-DERIVE, keySize={192,521}, hw, derive, other flags=0x1d00000
  ECDSA-KEY-PAIR-GEN, keySize={192,521}, hw, generate_key_pair, other flags=0x1d00000
  RSA-X-509, keySize={1024,4096}, hw, decrypt, sign, verify
  RSA-PKCS, keySize={1024,4096}, hw, decrypt, sign, verify
  SHA1-RSA-PKCS, keySize={1024,4096}, sign, verify
  SHA256-RSA-PKCS, keySize={1024,4096}, sign, verify
  SHA384-RSA-PKCS, keySize={1024,4096}, sign, verify
  SHA512-RSA-PKCS, keySize={1024,4096}, sign, verify
  MD5-RSA-PKCS, keySize={1024,4096}, sign, verify
  RIPEMD160-RSA-PKCS, keySize={1024,4096}, sign, verify
  RSA-PKCS-PSS, keySize={1024,4096}, hw, sign
  SHA1-RSA-PKCS-PSS, keySize={1024,4096}, sign
  SHA256-RSA-PKCS-PSS, keySize={1024,4096}, sign
  RSA-PKCS-KEY-PAIR-GEN, keySize={1024,4096}, generate_key_pair

 

위에는 RSA 4096bit까지 지원한다는데 아래를 보면 4096bit 키 생성에 실패한다.

C:\Program Files\OpenSC Project\OpenSC\tools>powershell "Measure-Command{.\pkcs11-tool -l -p 123456 --keypairgen --key-type rsa:1024 --id 10}"
Using slot 0 with a present token (0x0)


Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 3
Milliseconds      : 816
Ticks             : 38160192
TotalDays         : 4.41668888888889E-05
TotalHours        : 0.00106000533333333
TotalMinutes      : 0.06360032
TotalSeconds      : 3.8160192
TotalMilliseconds : 3816.0192




C:\Program Files\OpenSC Project\OpenSC\tools>powershell "Measure-Command{.\pkcs11-tool -l -p 123456 --keypairgen --key-type rsa:4096 --id 11}"
Using slot 0 with a present token (0x0)
error: PKCS11 function C_GenerateKeyPair failed: rv = CKR_DATA_INVALID (0x20)
Aborting.


Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 1
Milliseconds      : 448
Ticks             : 14481619
TotalDays         : 1.67611331018519E-05
TotalHours        : 0.000402267194444444
TotalMinutes      : 0.0241360316666667
TotalSeconds      : 1.4481619
TotalMilliseconds : 1448.1619




C:\Program Files\OpenSC Project\OpenSC\tools>powershell "Measure-Command{.\pkcs11-tool -l -p 123456 --keypairgen --key-type rsa:2048 --id 11}"
Using slot 0 with a present token (0x0)


Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 18
Milliseconds      : 22
Ticks             : 180227754
TotalDays         : 0.0002085969375
TotalHours        : 0.0050063265
TotalMinutes      : 0.30037959
TotalSeconds      : 18.0227754
TotalMilliseconds : 18022.7754




C:\Program Files\OpenSC Project\OpenSC\tools>powershell "Measure-Command{.\pkcs11-tool -l -p 123456 --keypairgen --key-type rsa:2048 --id 12}"
Using slot 0 with a present token (0x0)


Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 29
Milliseconds      : 775
Ticks             : 297756544
TotalDays         : 0.00034462562962963
TotalHours        : 0.00827101511111111
TotalMinutes      : 0.496260906666667
TotalSeconds      : 29.7756544
TotalMilliseconds : 29775.6544

C:\Program Files\OpenSC Project\OpenSC\tools>powershell "Measure-Command{.\pkcs11-tool -l -p 123456 --keypairgen --key-type rsa:2048 --id 13}"
Using slot 0 with a present token (0x0)


Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 20
Milliseconds      : 652
Ticks             : 206522924
TotalDays         : 0.000239031162037037
TotalHours        : 0.00573674788888889
TotalMinutes      : 0.344204873333333
TotalSeconds      : 20.6522924
TotalMilliseconds : 20652.2924

용량을 잘 모르겠다.

일단 RSA 1024 * 8, RSA 2048 * 10 => 28672bit -> 28672 byte 까지는 된다.

 

4kb 인가?

반응형

댓글