从VBA解密PGP加密文件的最简单方法(MS Access) [英] Easiest way to decrypt PGP-encrypted files from VBA (MS Access)

查看:124
本文介绍了从VBA解密PGP加密文件的最简单方法(MS Access)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要编写代码来从FTP位置提取PGP加密的文件并进行处理.这些文件将使用我的公共密钥加密(不是我还没有).显然,我需要一个可以在Microsoft Access中使用的PGP库.您能推荐一种易于使用的工具吗?

I need to write code that picks up PGP-encrypted files from an FTP location and processes them. The files will be encrypted with my public key (not that I have one yet). Obviously, I need a PGP library that I can use from within Microsoft Access. Can you recommend one that is easy to use?

我正在寻找不需要大量PKI知识的东西.理想情况下,可以轻松生成一次性的私钥/公钥对,然后具有用于解密的简单例程的事物.

I'm looking for something that doesn't require a huge amount of PKI knowledge. Ideally, something that will easily generate the one-off private/public key pair, and then have a simple routine for decryption.

推荐答案

命令行解决方案很好.如果您的数据库是内部应用程序,而不是要重新分发,我可以推荐 Gnu Privacy Guard .这个基于命令行的工具将允许您执行与OpenPGP标准有关的任何事情.

A command line solution is good. If your database is an internal application, not to be redistributed, I can recommend Gnu Privacy Guard. This command-line based tool will allow you to do anything that you need to with regard to the OpenPGP standard.

在Access内,您可以在宏中使用Shell()命令,如下所示:

Within Access, you can use the Shell() command in a Macro like this:

Public Sub DecryptFile(ByVal FileName As String)
  Dim strCommand As String
  strCommand = "C:\Program Files\GNU\GnuPG\gpg.exe " _
  & "--batch --passphrase ""My PassPhrase that I used""" & FileName
  Shell strCommand, vbNormalFocus
End Sub

这将运行命令行工具来解密文件.此语法使用您的秘密密码的纯文本版本.这不是最安全的解决方案,但是如果您的数据库是内部数据库并且仅由受信任的人员使用,则可以接受. GnuPG支持其他保护密码短语的技术.

This will run the command-line tool to decrypt the file. This syntax uses a plaintext version of your secret passphrase. This is not the most secure solution, but is acceptable if your database is internal and only used by trusted personnel. GnuPG supports other techniques to secure the passphrase.

这篇关于从VBA解密PGP加密文件的最简单方法(MS Access)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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