用数字标志创建文件 [英] file creation with digital sign

查看:122
本文介绍了用数字标志创建文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个asp.net C#程序,用我的扩展名创建一个文件(比如filename.ek),并将一些文本数据写入该文件。重要的是,只有我的应用程序可以读取该文件中的数据。即我需要用数字符号将数据写入文件。请给出c#代码...

I need a asp.net C# program for create a file with my on extension (ie. like filename.ek), and wright some text data to that file. The important thing is, only my application can read the data inside that file. i.e i need to write the data to the file with digital sign. Please give the c# code...

推荐答案

请看我对这个问题的评论。



In与此同时,你可以自己弄清楚这一切。如果你学习了公钥加密系统和相关的数字签名的概念,那将很容易:

http://en.wikipedia.org/wiki/Public-key_cryptography [ ^ ],

http://en.wikipedia.org/wiki/Digital_signature [ ^ ]。



有一整套用于公钥加密的算法,在伞术语 非对称加密算法



另请参见:

http://en.wikipedia.org/wiki/RSA_%28algorithm%29 [ ^ ],

http:/ /en.wikipedia.org/wiki/Digital_Signature_Algorithm [ ^ ]],

http://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm [ ^ ]。



关于所需算法的实现,.NET BCL中已经为您提供了所有内容。请参阅:

http://msdn.microsoft .com / zh-cn / library / system.security.cryptography.asymmetricalgorithm.aspx [ ^ ]。



-SA
Please see my comment to the question.

In the meanwhile, you can probably figure out it all by yourself. It will be easy enough if you learn the concept of public-key cryptography system and related digital signature:
http://en.wikipedia.org/wiki/Public-key_cryptography[^],
http://en.wikipedia.org/wiki/Digital_signature[^].

There is a whole family of the algorithms used for the public-key cryptography, known under the umbrella term of asymmetric cryptographic algorithms.

See also, in particular:
http://en.wikipedia.org/wiki/RSA_%28algorithm%29[^],
http://en.wikipedia.org/wiki/Digital_Signature_Algorithm[^] ],
http://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm[^].

As to the implementation of required algorithms, everything is already provided in the .NET BCL for you. Please see:
http://msdn.microsoft.com/en-us/library/system.security.cryptography.asymmetricalgorithm.aspx[^].

—SA


可能有另一个问题的视图。您似乎不希望其他人看到您文件中的数据。一种解决方案可能是在您的程序中使用加密。您在编写文件时加密文件中的数据,因为它是加密的,所以没有人能看到它。



加密你可以使用下面的链接



http://social.msdn.microsoft.com/Forums/vstudio/en-US/d6a2836a-d587-4068-8630-94f4fb2a2aeb/encrypt-and-decrypt-a-string -in-c [ ^ ]



http://en.wikipedia.org/wiki/Encryption [ ^ ]
There could be another view of the problem. It seems that you don't want other to see the data present in your file. One solution could be to use encryption in your program. You encrypt the data in the file while you write it and since its encrypted so no one could see it.

For encryption you can use below links

http://social.msdn.microsoft.com/Forums/vstudio/en-US/d6a2836a-d587-4068-8630-94f4fb2a2aeb/encrypt-and-decrypt-a-string-in-c[^]

http://en.wikipedia.org/wiki/Encryption[^]


这篇关于用数字标志创建文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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