如何在C#和Vba中加密和解密字符串 [英] How Do I Encrypt And Decrypt Strings In Both C# And Vba

查看:101
本文介绍了如何在C#和Vba中加密和解密字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在C#和VBA代码中加密和解密字符串,例如我需要使用相同的密钥,两个代码都应该生成相同的加密序列,这样我就可以在VBA中使用加密密钥在C#中解密,反之亦然。



对此有任何帮助表示赞赏。



谢谢。

How do I Encrypt and Decrypt strings in both C# and VBA code such as I need to use same passkey and both codes should generate same encrypted sequence, so that I can use encrypted key in VBA to decrypt in C# and vice-versa.

Any help on this is appreciated.

Thank you.

推荐答案

首先需要您自己进行一些研究。



你会在这些CP文章 [ ^ ]
A little research on your own behalf is required first.

You will find several suggestions in these CP articles[^]


使用相同的加密算法。



这里有一个关于VBA的AES示例: http:// bytes的.com /主题/访问/见解/ 906850-AES的加密算法,VBA的VBScript的 [<啊ref =http://bytes.com/topic/access/insights/906850-aes-encryption-algorithm-vba-vbscript\"target =_ blanktitle =New Window> ^ ]和C#支持AES: https://msdn.microsoft.com /en-us/library/system.security.cryptography.aes(v=vs.110).aspx [ ^ ]这是一种方法。
Use the same encryption algorithm.

There is an example of AES for VBA here: http://bytes.com/topic/access/insights/906850-aes-encryption-algorithm-vba-vbscript[^] and C# supports AES: https://msdn.microsoft.com/en-us/library/system.security.cryptography.aes(v=vs.110).aspx[^] so that is one way to go.


你可以谷歌出很多解决方案,关于C#,这篇文章中的代码很有帮助。

https://social.msdn.microsoft.com/Forums/vstudio/en-US/d6a2836a -d587-4068-8630-94f4fb2a2aeb / encrypt-and-decrypt-a-string-in-c [ ^ ]
You can google out a lot solutions,About C#,code in this post is helpful.
https://social.msdn.microsoft.com/Forums/vstudio/en-US/d6a2836a-d587-4068-8630-94f4fb2a2aeb/encrypt-and-decrypt-a-string-in-c[^]


这篇关于如何在C#和Vba中加密和解密字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆