Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't execute simple function #50

Closed
Hooch180 opened this issue Apr 23, 2014 · 3 comments
Closed

Can't execute simple function #50

Hooch180 opened this issue Apr 23, 2014 · 3 comments

Comments

@Hooch180
Copy link

Hello.

This is my code:
var jsEngine = new Jint.Engine();
jsEngine.Execute(rsaBiJs);
jsEngine.Execute(rsaJs);
jsEngine.SetValue("modStr", modStr);
jsEngine.SetValue("expStr", expStr);
jsEngine.SetValue("password", UserPassword);
jsEngine.Execute(@"var pubKey = RSA.getPublicKey( modStr, expStr );");
jsEngine.Execute(@"password = password.replace( /[^\x00-\x7F]/g, '' );");
jsEngine.Execute(@"var encryptedPassword = RSA.encrypt( password, pubKey );");
string encryptedPassword = jsEngine.GetValue("encryptedPassword").AsString();

Where:
rsaJs is string whitch contents this script: https://steamstore.map2.ssl.hwcdn.net/public/javascript/crypto/rsa.js

rsaBiJs:
https://steamstore.map2.ssl.hwcdn.net/public/javascript/crypto/jsbn.js

modStr and expStr are just strings. (Yes. Those have proper data in them).

It fails on this line:
jsEngine.Execute(rsaBiJs);

@Miramac
Copy link

Miramac commented Apr 23, 2014

maybe encoding? Try UTF-8 encoding for the include files.

Hope this will help :)

@sebastienros
Copy link
Owner

So it actually fails on the first line of your code, loading https://steamstore.map2.ssl.hwcdn.net/public/javascript/crypto/jsbn.js, all the extra lines are unnecessary to reproduce. I will try that if you confirm.

@lahma
Copy link
Collaborator

lahma commented Jan 1, 2019

Closing as obsolete.

@lahma lahma closed this as completed Jan 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants