RSA public key decrypt failed #62

Closed
opened 2015-04-06 21:45:17 -05:00 by badnoodle · 1 comment
badnoodle commented 2015-04-06 21:45:17 -05:00 (Migrated from github.com)

I just change the rsa_test.c:

len2 = sizeof(tmp);
DO(rsa_export(tmp, &len2, PK_PRIVATE, &key));
DO(rsa_import(tmp, len2, &pk));
len2 = sizeof(tmp);
DO(rsa_export(tmp, &len2, PK_PUBLIC, &key));
DO(rsa_import(tmp, len2, &sk));

encrypt use private key:
DO(rsa_encrypt_key(in, rsa_msgsize, out, &len, NULL, 0, &yarrow_prng, prng_idx, hash_idx, &pk));

decrypt use public key:
DO(rsa_decrypt_key(out, len, tmp, &len2, NULL, 0, hash_idx, &stat, &key));

then the test failed, and promot is: A private PK key is required.

does anyone help me ?

I just change the rsa_test.c: len2 = sizeof(tmp); DO(rsa_export(tmp, &len2, PK_PRIVATE, &key)); DO(rsa_import(tmp, len2, &pk)); len2 = sizeof(tmp); DO(rsa_export(tmp, &len2, PK_PUBLIC, &key)); DO(rsa_import(tmp, len2, &sk)); encrypt use private key: DO(rsa_encrypt_key(in, rsa_msgsize, out, &len, NULL, 0, &yarrow_prng, prng_idx, hash_idx, &pk)); decrypt use public key: DO(rsa_decrypt_key(out, len, tmp, &len2, NULL, 0, hash_idx, &stat, &key)); then the test failed, and promot is: A private PK key is required. does anyone help me ?
sjaeckel commented 2015-04-07 05:21:13 -05:00 (Migrated from github.com)

Invalid

as mentioned in IRC:

10:18 < jaeckel> badnoodle: you should probably read https://en.wikipedia.org/wiki/Public-key_cryptography
Invalid as mentioned in IRC: ``` 10:18 < jaeckel> badnoodle: you should probably read https://en.wikipedia.org/wiki/Public-key_cryptography ```
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-libtom/libtomcrypt#62
No description provided.