encryption-decryption's Introduction
1. All the programs first check permission of the file and execute only when the user has appropriate permission to access the file 2. gen_rand program takes a no. and a filename as command line argument and generates random bytes of that len and saves them in the encrypted form in the filename given as command line argument. To encrypt the random bytes gen_rand program first call get_key_iv function to get the key and iv derived from the user hashed password and then encrypt the random bytes using aes-ecb with key and iv. gen_rand 10 randfile 3. fput_encrypt_rsa program takes file with random bytes, privatekey file, and output file. First this program decrypts the random bytes and use these random bytes to generate key and iv. This key and iv is then used to encrypt the output file passed as command line argument. At the end this program generates a RSA HMAC for this output file and store it in file.sign file. fput_encrypt_rsa randfile key.priv tempfile 4. fget_decrypt_rsa program takes file with random bytes, publicKey file and filename as command line argument. First this program verifies the RSA HMAC for the file, if the verification is successful it proceeds otherwise it terminate the process. If the verification is successful it then decrytps the file and outputs the content of the file on terminal. fget_decrypt_rsa randfile key.pub tempfile Corner Cases: 1. all the programs will only work when the other user have appropriate permission to do the operation on the file. 2.fget_decrypt_rsa will only work when both the file and the signature file has the read permission. 3.even though the signatur is being generated by some other user for a fie but the owner of that signature file will always be the same as the owner of of the file 4. To read a file user should also have read permission to the randomfile.
encryption-decryption's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.