Coder Social home page Coder Social logo

file-signing-and-encryption's Introduction

DES/RSA加密
1.首先生成密钥,导出到输入输出DES文件夹下的des.txt、rkb.txt、ukb.txt、n2.txt中(文件后缀名txt需自己添加)。
2.输入文件字符串.txt、大作业2020.pdf或者其他任意文件。导入RSA密钥(公钥加密私钥解密)、DES密钥k、模n2。
3.混合加密并输出到字符串.des、大作业2020.des或自己定义其他名字的文件中(文件后缀名des需自己添加)。虽然des文件和原文件大小显示一样,其实不一样,经加密的DES密钥k已经附到后面了,只不过太小了(扩充为128byte),kb级上可忽略。
4.重新导入RSA密钥(公钥加密私钥解密),DES密钥显示已导入但实际上解密并不需要它,解密的DES密钥是从接收到的文件末尾提取出来的,混合解密并输出得到原文件(文件后缀名需自己添加,原文件是什么后缀名就添加什么后缀名)。
数字签名
1.首先生成密钥,导出到输入输出DES文件夹下的rka.txt、uka.txt、n1.txt中(文件后缀名txt需自己添加)。
2.输入文件字符串.txt、大作业2020.pdf或者其他任意文件。导入RSA密钥(私钥加密公钥解密)、模n1。
3.签名并输出签名文件到字符串.md5、大作业2020.md5或自己定义其他名字的文件中(文件后缀名md5需自己添加)。虽然md5文件和原文件大小显示一样,其实不一样,经加密的Hash码已经附到后面了,只不过太小了(扩充为128byte),kb级上可忽略。
4.重新导入RSA密钥(私钥加密公钥解密),输出原文件(文件后缀名需自己添加,原文件是什么后缀名就添加什么后缀名),并经过对比显示签名对比结果。
注: MFC界面代码为个人编写,RSA、MD5、DES参考了CSDN的代码

file-signing-and-encryption's People

Contributors

liyang977 avatar

Forkers

chenxy1986

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.