Home > Back-end >  RSA encryption, decryption and Base64 encryption after the problem
RSA encryption, decryption and Base64 encryption after the problem

Time:02-09

Dear bosses, good!
Want to ask about a RSA encryption, decryption and Base64 encryption after the problem,

The problem is this:
Has a long string, need through the RSA encryption, and then to Base64 encryption, but when RSA encryption, expressly limited (if it is a 1024 - bit cipher text is definitely a maximum length of 1024/8-11=117), so long string encryption has a problem, can only be encrypted is divided, my approach is to block encryption, and encrypted spliced together, simple encryption, RSA section and then decrypt the private key (public key encryption, decryption), the normal, but when I RSA encryption, after either block encryption Base64 encryption, or RSA encryption after overall Base64 encryption, decryption again when (first Base64 decryption, RSA decryption), the decryption is correct, have a great god in this case?

CodePudding user response:

In theory, no problem, I used the private key encryption to base64 encoding, base64 decoding using public key to decrypt again, before you see the length of the after base64 decoding and encoding of a different length

CodePudding user response:

Is nothing but to look at the end of a filling
  • Related