問題描述:apache
數據加密後:密文每76個字符後換行加密
QTY0NTNGOTFCOEJEMEU1QjBFRTBBODZCRTBBNDEyMjQzQzExNkVCM0U0MzM5RTc3MDE3M0ZFNjYz NjJDM0Q5NjMwRTk0REE4NDgzOTk3OEUyMDBCNDlCQ0Y0MEIyOUZCRTZGREUxNkVBN0UyMTJENTVD M0Q0MzkwNDU1NDE5NkFGMTM0RUZBRUVGMEUxMUUxMjYwRTI5NjY3MjMyOURBMjgyMjQ3RjFDQ0I4 NDVFNTk2MzAxRjMwMDIxMkYwMURFMTc3RTFGMkIxREQxQ0IwMUEwQ0NCMDg1MDIxNEU1NUYwRUY1 RDZDMUQ1NzUzODI5MDA2NTQwOTY5OUM4REVERkUxOTg0NTQyQjVBRTMyRDM5RjUzMkRFQjMxNkNF MkQw
密文用String類型返回:變一行,存在換行符(\n)spa
QTY0NTNGOTFCOEJEMEU1QjBFRTBBODZCRTBBNDEyMjQzQzExNkVCM0U0MzM5RTc3MDE3M0ZFNjYz\nNjJDM0Q5NjMwRTk0REE4NDgzOTk3OEUyMDBCNDlCQ0Y0MEIyOUZCRTZGREUxNkVBN0UyMTJENTVD\nM0Q0MzkwNDU1NDE5NkFGMTM0RUZBRUVGMEUxMUUxMjYwRTI5NjY3MjMyOURBMjgyMjQ3RjFDQ0I4\nNDVFNTk2MzAxRjMwMDIxMkYwMURFMTc3RTFGMkIxREQxQ0IwMUEwQ0NCMDg1MDIxNEU1NUYwRUY1\nRDZDMUQ1NzUzODI5MDA2NTQwOTY5OUM4REVERkUxOTg0NTQyQjVBRTMyRDM5RjUzMkRFQjMxNkNF\nMkQw
解密改密文(存在換行符)時報錯:須要對密文的換行符進行轉義code
org.apache.commons.lang3.StringEscapeUtilsstring
StringEscapeUtils.unescapeJava(string);數據