在Delphi中加密/解密文本文件? [英] Encrypt/ Decrypt text file in Delphi?

查看:660
本文介绍了在Delphi中加密/解密文本文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我想知道最好的加密技术的文本文件加密和加密。

Hi i would like to know best encryption technique for text file encryption and ecryption.

我的方案:

我有两种用户类型的软件。我们的要求是当管理员使用GUI输入数据并加以保存时加密文本文件。该加密文件将被输入到运算符,他们只需要选择它并使用该文件。这里的文件应该在操作员选择这些文件时自动解密数据,以便进一步计算。

I have software having two type of users Administartor and Operators. Our requirement is to encrypt text file when Administrator enter data using GUI and save it. That encrypted file would be input for Operator and they just need to select it and use that file. Here file should be automatically decrypt data for further calculation when Operator select those files.

请帮助我使用哪种加密/解密技术?

Please help me which encryption/ decryption technique should i use?

推荐答案

做加密时的一个黄金规则是要理解加密作为一个整体是非常困难的。

A golden rule when doing crypto is to understand that cryptography as a whole it is very difficult.

有许多不同的方法/算法可供选择,没有一个算法/方法可以说是最好的。这取决于您的需求和影响应用程序分发的可能性等。

There are a multitude of different approaches/algorithms to choose from, and no single algorithm/method can be said to be the best one. It all depends on your needs and possibilities to affect application distribution etc.

一个潜在的问题情况的例子是,在您的场景中,解密密钥需要分布与应用程序,可能会使其不安全。这通常被称为密钥分发问题。

An example of a potentially problematic situation is that in your scenario the decryption "key" needs to be distributed with the application(s) and might make it insecure. This is generally referred to as the "Key Distribution" problem.

开始阅读crypto的好地方是 http://en.wikipedia.org/wiki/Cryptography

A good place to start reading about crypto is http://en.wikipedia.org/wiki/Cryptography.

Delphi的东西有几个好的包可用:

As for ready made stuff for Delphi there are a few good packages available:

  • DEC v5.2 - http://blog.digivendo.com/2008/11/delphi-encryption-compendium-dec-52-for-d2009-released/
  • DCPCrypt - http://www.cityinthesky.co.uk/cryptography.html

Torry的页面还有一个很长的组件列表:

Torry's pages also has a long list of components:

  • http://www.torry.net/pages.php?id=519
  • http://www.torry.net/pages.php?id=312

我强烈建议您使用一些现有的实现,而不是开始自己做,因为创建安全的工作加密算法是非常困难的。

I strongly recommend you use some of the existing implementations and not start to do your own, since creating a secure working crypto algo is very very difficult.

这篇关于在Delphi中加密/解密文本文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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