a thoughtful web.
Good ideas and conversation. No ads, no tracking.   Login or Take a Tour!
comment
lcguedes  ·  4261 days ago  ·  link  ·    ·  parent  ·  post: A simple hexadecimal "bignum" library, in C.

Thank you for your decrypt, but I think it is not going to work. You need something like:

  ////////////////////////////////////////////////////////////////////////////
  //
  void rsaDecrypt( hex_bignum_t *ciphertext_ptr, hex_bignum_t *plaintext_ptr, rsaSecKey_t *privkey_ptr )
  {
     HB_modexp( ciphertext_ptr, &(privkey_ptr->d), &(privkey_ptr->n), plaintext_ptr );
  }
where, (d * e) % ((p-1)*(q-1)) = 1, p*q = n.