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hello world |
加密
java
1 | UgnRdVY7thSMN8dM5gg+wcMu7g8PmQclLFnoswkT9J8aB8RfU+LQhfKupRVifipg03LvVGedqQmXyF5Gz8AoDIW22q5kpLxpdS3sZdf2kQY6snDSHubtPszG+/jB05fYaCGCPvoJw1oD+HHWl6dF5GvTYvLcZykRAJtvr5vCjTg= |
node
1 | iQMK9U8wYsLdhssRVRVY0CA40SdM3PEP7KhuP74ICPA7AH0ckUw5Rq9C8RKAIBh0fO8hIYC+kPN9xUCKNUlFGy09xtBEOgRybg8JZZC8mEjeA0hHMbQePI4fxQa74IWYY646ihj7KCtaE55yE6G8yV7hRPFyjdPJieXEKhSJsmM= |
js
1 | hOv454LZNZhPoS2nbtnH7S1phhkdVVX0NtF7xx37H4tNKelTguQ0i/obZXBGVRC7FoP0CAP7lrqo/VlT276D9kLXHUGSl/9FW1Q4fNcj4iMZedjcQJaZNOSZ4Vlti/9cXUeuUXaGG6vS3V49EfMy/FELFy+zpbijcnrIAar6uh4= |
解密
加密\解密 | java | node | js |
---|---|---|---|
java | 可以解密 | 可以解密 | 可以解密 |
node | 可以解密 | 可以解密 | 可以解密 |
js | 可以解密 | 可以解密 | 可以解密 |
Java
1 | package pub.wii.cook.springboot.utils; |
Node
1 | npm i node-rsa |
1 | const NodeRSA = require('node-rsa') |
JS
使用 openstack 实现的 jsencrypt.js 。
1 | var encrypt=new JSEncrypt(); |
参考
- https://stackoverflow.com/questions/42638068/signing-decoding-with-base-64-pkcs-8-in-node-js
- https://www.devglan.com/online-tools/rsa-encryption-decryption
- https://www.devglan.com/java8/rsa-encryption-decryption-java
- https://github.com/openstack/xstatic-jsencrypt/blob/master/xstatic/pkg/jsencrypt/data/jsencrypt.js