Skip to content

Byte order and TLbBigInt #16

Description

@1one-w01f

Hi,

I am trying to use the RSA module to do some signature verification, and I found that the byte order of TLbBigInt to be kind of funny.

If I do this to load pubkey.der which was generated using OpenSSL,

pubKey := TLbRSAKey.Create(aks1024);
pubKey.LoadFromFile('pubkey.der');

then the modular exponentiation seems to be wrong. Somehow I had to reverse the byte order of the modulus to make it working.

However, even if the modular exponentiation works, the signature verification cannot succeed, because at line 688 of LbRSA.pas, the byte orders of SHA1Digest1 and SHA1Digest2 are reverse of each other (I checked the Local Variables by using adding a breakpoint there), and thus Result will be False.

Any thoughts on this?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions