auto encryption and decryption of files during log in and log off


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting auto encryption and decryption of files during log in and log off
# 1  
Old 09-29-2012
auto encryption and decryption of files during log in and log off

we r to develope a project which involves automatic encryption of all the text files user was working upon during logg off
and to decrypt them during log on
this is to be done by writing a shell script
can anyone help
# 2  
Old 09-29-2012
I don't think I want to help you try to write a script like this, but here are a few issues to consider if you really want to pursue this project:
  1. What constitutes "was working upon during logg (sic) off"? (Open in an editor? If so, do you have a list of editors to be used for this purpose?)
  2. What encryption/decryption tools do you plan to use that don't need user interaction to enter an encryption/decription key?
  3. How do you plan to determine that a file is a text file? (File extension of ".txt", file utility contains "text" in the output it produces when processing the file as an operand, ...?)
  4. How do you plan to keep from corrupting files if a user is logged in twice and logs out of one session while continuing to process files in another login session?
  5. Do you have any plan on a way to recover from a power failure that occurs while some users are logged in (or even worse; while one or more users were in the process of logging in or out)?
  6. If a sysadmin is editing a system configuration file when being logged out (such as /etc/passwd or /etc/group) and you encrypt those files as that user logs out, no one will be able to login after that until those files are restored. If any users edit files shared with other people working on a common project, you will have destroyed the ability to share files.

Good luck,
Don
# 3  
Old 09-29-2012
How about an encrypted file system? You need a password to work on the files.
This is a far more sensible approach. We had this long ago at Los Alamos National Labs (NM, USA) where security followed Orange book B requirements. That is FAR more stringent than anything you can afford to implement.

What you are doing is probably ill-conceived, and motivations are good, but Don Cragun was too polite to say that.

consider this free toolkit for Linux, other OS software exists, too:

Filesystem Encryption Tools for Linux

The probability of you getting this requirement to work is low, and getting it to work flawlessly is very low, IMO. It has to be done at a very low level (kernel mode or in filesystem drivers), not with shell scripts. The probability is high that you will irreversibly damage files. And if accidentally you do that to system files, you lose the whole system. If you do proceed with your shell script approach, be very scrupulous about backing up files, because you will definitely have problems.

Just my opinion, trying to prevent big problems for you. Not trying to squash innovation.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Gpg (GnuPG) encryption and decryption

Hi Friends, There are some 7 years script in out linux server. I am trying to understand them since Linux Server changed(A). Below line in one of the encrypting script. Here scenario is encrypting bank files in our (A) server and doing Secure Copy to Server (B). GPG -v --batch --yes --armor... (1 Reply)
Discussion started by: johnsnow
1 Replies

2. Shell Programming and Scripting

Redirecting log files to null writing junk into log files

Redirecting log files to null writing junk into log files. i have log files which created from below command exec <processname> >$logfile but when it reaches some size i am redirecting to null while process is running like >$logfile manually but after that it writes some junk into... (7 Replies)
Discussion started by: greenworld123
7 Replies

3. Ubuntu

help regarding encryption and decryption of files on linux

we are to develope a project on linux whose aim is to automatically encrypt files after logoff and to decrypt them using password after log in this is to be made by chging source code of linux ........... can any one help me on this???? (1 Reply)
Discussion started by: vyom
1 Replies

4. Shell Programming and Scripting

String encryption and decryption

Hello All, There are so many questions on this and I didn't find any concluded answer. I want to encrypt a string in the script, actually this is a password. I tried using openssl (I am a newbie to openssl), but it is generating a long one which we can't remember. I want to encrypt the... (5 Replies)
Discussion started by: karumudi7
5 Replies

5. Shell Programming and Scripting

How can view log messages between two time frame from /var/log/message or any type of log files

How can view log messages between two time frame from /var/log/message or any type of log files. when logfiles are very big and especially many messages with in few minutes, I would like to display log messages between 5 minute interval. Could you pls give me the command? (1 Reply)
Discussion started by: johnveslin
1 Replies

6. UNIX for Dummies Questions & Answers

Identify a file for encryption or decryption

Dear Members, Can we find if a particular file is encrypted or decrypted. I need a command by which i should be able to identify if a file is encrypted or decrypted. How can we do this? (1 Reply)
Discussion started by: sandeep_1105
1 Replies

7. Solaris

encryption & decryption functions in sun solaries

hi, is there any library functions available in sun solaries for encryption and decryption functions. regards suresh (1 Reply)
Discussion started by: suresh_rtp
1 Replies

8. Solaris

PGP encryption/decryption solaris 9

Hi Someone is going to send me a file that they have encrypted by PGP encryption on windows pc to my solaris 9 server. They will give me the pgp key to decrypt the file. How can I do this on solaris 9 Is there a tool installed by default to decrypt or do I need to install something to... (0 Replies)
Discussion started by: frustrated1
0 Replies

9. Programming

Password encryption/decryption in flat-text files

Dear all, If anyone has some ideas for me how to tackle the following situation: Imagine a type of client-server application. The client application is started by a human operator with all the necessary LDAP/Kerberos in place. The server application is started automatically as a daemon process.... (2 Replies)
Discussion started by: domivv
2 Replies

10. UNIX for Dummies Questions & Answers

File Encryption and Decryption in UNIX.

Hello guys ! I have used "crypt <first> second" command to encrypt "first" to "second" file. i have assign a key for that of course. Now when i try to look content of "seocnd" file through "cat second" command, the file is encrypted and cannot be read which is according to plan. But when... (3 Replies)
Discussion started by: abidmalik
3 Replies
Login or Register to Ask a Question