login about faq

Hello, i have troubles with chilkat rsa.

i'm trying:

QString akey = "<rsakeyvalue><modulus>" + mod + "</modulus><exponent>" + exp + "</exponent></rsakeyvalue>";
rsa->ImportPublicKey(akey.toStdString().c_str());
rsa->put_EncodingMode("base64");
rsa->put_LittleEndian(false);
QString password = rsa->encryptStringENC("abcd", false);

All ok, but Steam can't recognize this. Alternative code with openssl work good!

publickey = RSA_new();
        BIGNUM *publickey_mod = BN_new();
        BIGNUM *publickey_exp = BN_new();

//QString -> String -> Char* -> BIGNUM
        BN_hex2bn(&publickey_mod, modulus.toStdString().c_str());
        BN_hex2bn(&publickey_exp, exponent.toStdString().c_str());

//Adds data to RSA publickey
        publickey->n = publickey_mod;
        publickey->e = publickey_exp;
    encrypted = new unsigned char[RSA_size(publickey)];

if (RSA_public_encrypt(input.length(), reinterpret_cast<const unsigned="" char="" *="">(input.toStdString().c_str()), encrypted, &(*publickey), RSA_PKCS1_PADDING) == -1)
        {
            delete[] encrypted;
            encrypted = NULL;
        }

asked Jul 19 '15 at 22:16

BaneAlex's gravatar image

BaneAlex
1


On JavaScript Steam have code:

var pubKey = RSA.getPublicKey( results.publickey_mod, results.publickey_exp );
var encryptedPassword = RSA.encrypt( password, pubKey );
link

answered Jul 19 '15 at 22:56

BaneAlex's gravatar image

BaneAlex
1

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×48

Asked: Jul 19 '15 at 22:16

Seen: 628 times

Last updated: Jul 19 '15 at 22:57

powered by OSQA