public string Decrypt(Model.EncryptedMessage message, AccountWithPublicKey account, string secretPhrase) { var localMessageService = new LocalMessageService(); var decrypted = localMessageService.DecryptTextFrom(account.PublicKey, message.Message, message.Nonce, true, secretPhrase); return(decrypted); }
private static string GetNoteToSelfMessage(Transaction transaction) { if (transaction.EncryptToSelfMessage != null && transaction.SenderRs == _walletRepository.NxtAccountWithPublicKey.AccountRs) { var messageService = new LocalMessageService(); var message = transaction.EncryptToSelfMessage; var decryptedText = messageService.DecryptTextFrom(transaction.SenderPublicKey, message.Data, message.Nonce, message.IsCompressed, _walletRepository.SecretPhrase); return(decryptedText); } return(null); }