对敏感 Excel 数据进行编码

发布于 2024-10-15 00:33:22 字数 321 浏览 3 评论 0原文

我有一个 Excel 文件,其中包含敏感数据,在将其通过 FTP 传输到最终位置之前需要对其进行编码,但我不确定从哪里开始。我想要实现的是:

  1. 在 C# 中打开 Excel 文件
  2. 将数据导入 DataSet/Reader
  3. 循环遍历每个“单元格”并对每个值进行编码
  4. 创建一个包含编码数据的新 CSV 文件

打开文件并将其导入数据集非常简单(如果将数据放在数据集中是执行此操作的正确方法)但我不确定如何循环并编码每条信息,然后创建一个包含该信息的新文件。

有什么想法吗?

提前致谢, 布雷特

I have an Excel file that contains sensitive data that needs to be encoded before it's FTPd to it's final location but I'm not sure where to start. What I want to achieve is this:

  1. Open Excel file in C#
  2. Import data into DataSet/Reader
  3. Loop through each 'cell' and encode each value
  4. Create a new CSV file containing my encoded data

Opening the file and importing it into a dataset is easy enough (if having the data in a dataset is the correct way to do this) but I'm not sure how to loop through and encode each piece of information and then create a new file containing this.

Any ideas?

Thanks in advance,
Brett

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

油饼 2024-10-22 00:33:22

使用像 GnuPG 这样的外部工具来加密你的数据可能会更容易:

$ echo "hello world" > private_file
$ gpg -c private_file
$ cat private_file.gpg
<binary gibberish>
$ rm private_file
$ gpg private_file.gpg
gpg: CAST5 encrypted data
gpg: encrypted with 1 passphrase
gpg: WARNING: message was not integrity protected
$ cat private_file
hello world
$

我刚刚选择了一个对称的关键在这里,因为它简单又容易。

如果您打算经常执行此操作,最好生成一些密钥为您和您的收件人提供信息,以便您可以轻松加密发送给特定人员的数据。

Windows 版本的 GnuPG 可能不像您希望的那么友好; http://www.pgp.com 曾经提供了一个非常好的 Windows 程序来做到这一点,但我认为他们决定把目光放得更高,从简单易用的工具转向企业设备。也许他们的工具集仍然包含一些简单的东西......

It might be much easier to use an external tool like GnuPG to encrypt your data:

$ echo "hello world" > private_file
$ gpg -c private_file
$ cat private_file.gpg
<binary gibberish>
$ rm private_file
$ gpg private_file.gpg
gpg: CAST5 encrypted data
gpg: encrypted with 1 passphrase
gpg: WARNING: message was not integrity protected
$ cat private_file
hello world
$

I just picked a symmetric key here because it is simple and easy.

If you intend on doing this operation often, it would be better to generate some keys for you and your recipients, so you can easily encrypt data to those specific people.

The Windows version of GnuPG might not be as friendly as you would like; http://www.pgp.com used to offer a really nice Windows program to do this, but I think they decided to set their sights higher and move away from simple easy tools into enterprise contraptions. Maybe their toolset still includes something easy...

半衬遮猫 2024-10-22 00:33:22

我相信你的意思是加密而不是编码

为什么要加密每个单元格?然后,文件的使用者将必须解密每个单元格。使用哪个过程?

看起来加密整个文件是一个更容易/更好的选择。

这种加密的目的是什么?

如果要在 FTP 传输过程中保护其免受外部监视,请使用安全传输协议/工具,例如 SCP 或 SFTP,取决于服务器支持的内容。

如果是为了保护文件不被有权访问 FTP 站点的人访问,那么可以加密文件。并为您的用户提供解密方法。

I believe you mean encrypting rather than encoding.

Why do you want to encrypt every cell? The consumer of your file will then have to decrypt every cell. Using which process?

It looks like encryting the whole file is an easier/better option.

What's the purpose of this encryption?

If it's to protect it from external eyes during the FTP transfer, then use a secure transfer protocol/tool, such as SCP or SFTP, depending on what is supported by the server.

If it's to protect the file from people who have access to the FTP site, then yes, encrypt the file. And provide a way to your users to decrypt it.

那片花海 2024-10-22 00:33:22

scp 是一个选项吗?这样您就可以保持 Excel 文件原样。

Is scp an option instead? That way you can leave the excel file as is.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文