Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8715517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:51:54+00:00 2026-06-13T05:51:54+00:00

Resolved (look for my answer). I need help encrypting a password with RSA in

  • 0

Resolved (look for my answer). I need help encrypting a password with RSA in C++. I’m working for Blackberry10 in C++ and I’ve been looking for a RSA tutorial or something that walk me through the encrypting process but sadly I haven’t found anything consistant.

I’ve been told that the process consist basicaly in three steps:

1)Generate the RSA public key with the module and exponent.
2)Encrypt the text with the public key.
3)Encrypt the text again in base640.

If you are wondering why I need to follow this three steps is because I’m working in a banking app, and those are their requirements.

I’ve been searching all over and I haven’t found even how to make the first step, generate the public key with the module and the exponent (I already have both).

Any help will be appreciated.

Thanks.


Is not that I’m building the whole app by myself. We are a team and I need to encrypt just the client password with RSA and send it to the next step of the process. I do have experiencie working with Blackberry and RSA but in Java, where the process is a little bit easier, e.g: In java the first step once you got the module and public exponent is create the RSA Public Key Object through a very simple syntaxis: RSAPublicKey publicKey = new RSAPublicKey(new RSACryptoSystem(2048),ebytes, mbytes);. In this part is where I’m little bit lost because I haven’t found the proper BB10 documentation. I’m sorry if I created the illusion that I’m creating a whole encryption API by myself. BB10 has this security API based in hursa.h (https://developer.blackberry.com/native/beta/reference/com.qnx.doc.crypto/topic/about_rsa_raw.html) I’m trying to implement it, but I haven’t been successful. @owlstead @dajames @bta

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:51:55+00:00Added an answer on June 13, 2026 at 5:51 am

    Resolved. After doing some research and getting to know better with BB10 coding and RSA, I finally came out with the solution to successfuly encrypt a plain text with RSA and Base64 in C/C++ for BB10 or any other platform. Please take in consideration that I have the modulus and the public exponent of the rsa object from the services that I’m working with.

    The code:

        QByteArray answer;
    
        RSA* rsa = RSA_new();
    
        BIGNUM *modulus = BN_new();
        BIGNUM *exponent = BN_new();
        const char *modulusString = rsaObj->getM(); //My Modulus
        const char *exponentString = rsaObj->getE(); //My exponent
    
        BN_hex2bn(&modulus, modulusString);
        BN_hex2bn(&exponent, exponentString);
    
        rsa->n = BN_new();
        BN_copy(rsa->n, modulus);
        rsa->e = BN_new();
        BN_copy(rsa->e, exponent);
    
        int maxSize = RSA_size(rsa);
        qDebug() << "maxSize:" << maxSize;
    
        const char *inn = "1234";
        unsigned char *encrypted = (unsigned char*) malloc(maxSize);
        int bufferSize = RSA_public_encrypt(strlen(inn), (unsigned char *) inn,
                encrypted, rsa, RSA_PKCS1_PADDING);
    
        if (bufferSize == -1) {
            RSA_free(rsa);
            qDebug() << "Error";
        }
    
        QByteArray enc = QByteArray::fromRawData((const char*) encrypted, 256);
        answer = enc.toBase64();
    
        return answer;
    

    Thanks and I expect this helps to the new BB10 developers

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to have resource messages that contain EL expressions be resolved when loaded
I resolved this issue myself. It turns out that the activation framework requires some
semi Resolved It appears that the problem exists only when running in debug mode,
I'm trying to get this resolved in .NET 2.0 and unfortunately that is not
Okay suppose I have an array of objects that look like this: obj(from, to)
I need to write a query that will perform a keyword search on a
I have a couple classes that look like this public class ParentClass { public
Sometimes my application generates URLs that look like http://localhost/?Area= or http://localhost/SomeController?Area= I don't currently
I have been trying to parse Java exceptions that appear in a log for
This question is a followup to a previous question , that was resolved thanks

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.