Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, I want to encrypt a text using rsa encryption method. I did it using command openssl but i want it using my library api, the library api is as, ...
  1. #1
    Just Joined!
    Join Date
    Feb 2008
    Posts
    50

    RSA Encryption

    Hi,

    I want to encrypt a text using rsa encryption method. I did it using command openssl but i want it using my library api, the library api is as,

    int rsa_calc (unsigned char * msg, unsigned char * mod, int count, int exp, unsigned char result);

    I can't understand how i input public key (.pem file) and what will be the modulus (unsigned char * mod) and exponent (int exp) for any text.

    Is there any kind of formula to calculate modulus and exponent of the text.

    Please help on this.

  2. #2
    Linux Enthusiast Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    717
    unsigned char = 1 byte = 8 bit

    you would probably cast it to unsigned int and do the encryption on the numeric. how the RSA encryption works on a numeric should be clear if you understood how RSA works / the mathematics behind it.

    why use your api and not the openssl one? I ask because I don't trust the programming skills of software engineers and neither mine.

  3. #3
    Just Joined!
    Join Date
    Feb 2008
    Posts
    50
    Thanks for your reply Kloschüssel.. I can't use openssl here since I am doing this encryption at POS device where I can't use openssl or can't install any package on the device as it does't give permissions to install any package..

    I am trying with this API and hopefully will solve my problem.

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...