haxe-crypto icon indicating copy to clipboard operation
haxe-crypto copied to clipboard

RSA encryption hangs on JS-target

Open AlexKotik opened this issue 8 years ago • 2 comments

Hello! I wrote this code:

import com.hurlant.util.ByteArray;
import com.hurlant.util.der.PEM;

class Main {
    public static function main() {
        var key = PEM.readRSAPrivateKey("<PEM-key-here>");
        var src = ByteArray.fromInt32ArrayLE([10, 20, 30, 40]);
        var dst = new ByteArray();

        key.encrypt(dat, dst, 32);
        trace(dst.length);
    }
}

I compiled this code to JavaScript and run it in Internet Explorer. However the JavaScript interpreter hangs eating up a lot of memory (when I stopped it it was working for 10min and ate up 350Mb). Seems like an infinite loop or something is going on.

AlexKotik avatar Jan 10 '17 10:01 AlexKotik

Not maintaining this project myself anymore. If someone else wants to look at this, I will merge PRs.

soywiz avatar Jan 10 '17 10:01 soywiz

@Leadlace, Try to use my fork with some fixes (https://github.com/AliEn707/haxe-crypto). I had similar error on flash and native. I am trying to fix it now and planning to do pull request later.

WSandwitch avatar Jan 26 '17 13:01 WSandwitch