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

Compatible with Forge js #46

Open
luannguyenkhoa opened this issue Mar 19, 2019 · 0 comments
Open

Compatible with Forge js #46

luannguyenkhoa opened this issue Mar 19, 2019 · 0 comments

Comments

@luannguyenkhoa
Copy link

luannguyenkhoa commented Mar 19, 2019

Hi there,

I'm preferring this lib for doing my RSA Private key encryption by calling this method:
SwKeyConvert.PrivateKey.encryptPEM(privateKeyPEM,...)
and share the result with web js which using forge js to decrypt and vice versa. But unfortunately, it always runs into an issue PKCS8.PrivateKey.hasCorrectHeader badPassphrase in swift and Only 8, 16, 24, or 32 bits supported: 200 in JS that causes decryption getting failed.
Note: The encrypted result format is the same between 2 sides:

-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: AES-256-CBC,176B126DA24E0AF336D4C4753761DF17

3IeIljjYUL6qWWoFjGerepDPuZdN0WoMCm7smNXII2fy0xfMEXekrYvsz6KajQ7l
xxxxxxxxxxxxxx
UIdsADuuCrk2IFyDwBt3zCX4Zy12QqgbsNmaDcubo1DbwrWeKKjYka7Za85hb4Ua
-----END RSA PRIVATE KEY-----

Is there any idea to make this encryption working on both these sides?
Thanks.

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

1 participant