在解密字节数组后无法转换为字符串

时间:2017-06-19 11:21:43

标签: android arrays encryption

能够加密数据但解密后无法转换为字符串。没有收到错误。解密只是成功但无法获得正确的字符串值得到一些decrpyted值。下面是代码

Word.Application wordApp = new Word.Application();
Word.Document myDoc;
myDoc = wordApp.Documents.Open(ref file, ReadOnly: false);
myDoc.Activate();

myDoc.PageSetup.DifferentFirstPageHeaderFooter = -1;

myDoc.Sections[1].Footers[Word.WdHeaderFooterIndex.wdHeaderFooterFirstPage].Range.Text = "First page text";
Object currentPage = Word.WdFieldType.wdFieldPage;
myDoc.Sections[1].Footers[Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Fields.Add(myDoc.ActiveWindow.Selection.Range, currentPage);

1 个答案:

答案 0 :(得分:-1)

你没有提到你的初始密码。我猜你没有正确地解密你的密码。 在加密/解密之前检查密码的初始化。检查密码的算法参数,并特别检查操作模式(ENCRYPT_MODE / DECRYPT_MODE)。有关详细信息,请参阅Android Developer Docs about javax.crypto.Cipher