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

有毒,会有几率加密出来的解不出来 #1

Open
chenzipeng1990 opened this issue Jan 4, 2018 · 2 comments
Open

有毒,会有几率加密出来的解不出来 #1

chenzipeng1990 opened this issue Jan 4, 2018 · 2 comments

Comments

@chenzipeng1990
Copy link

源文比较长的时候
试过做 一个100次的循环,会有几率出现加密出来的密文不正确,解析不出来

@chenzipeng1990
Copy link
Author

function a () {
var pri = "c14a12e8670975d9196b06617a68df840d128918e794132c82a984a9fcca8b60";
var pub = "048eb7b65f08bcea7b1f00985f86f5f67041c0bc43b56d2993478c21ed90a5d1743feb44d55bf285308fdedc8547f6647d7d4a26eeb6866f5a55357b137dacb542"

        var s = "{\"eParam\":\"04f019f9146a36e5272c4b250a89b3ebec0d786c1219aa00d00d3acaf7c866961fbad28efccae149c6ca8cb47d4ed766d1db14ca8a1d6ea0652048ecfcec04e0d3457801f5387dcfd4b228c71829d9e8d46688a1bf3b0967ccdd85cf29027ae14c1275bb1a482ef8f45ccd6638fc8f777f1336cb200bdb63ecab6f4fa576ec42ff261d74ef7be6d31cd9376cda510b37c60d5fd32ed86618c6f4e4563259021b007088357a73e1a88c309b0f8f345bda86a013f85240ca1bd7249d9a85d7cd70f5436a281e04c585807aa0cb3a85\"}";
        for (var i = 0; i < 100; i++) {
            var ct = sm2Encrypt(s, pub, 0);
            try {
                var dt = sm2Decrypt(ct, pri, 0);
            } catch (e) {
                console.error("出错了", ct, e)
            }
            console.log(i);
        }
    }

@sanchiqingfeng
Copy link

请问有解决吗

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

2 participants