LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 12-03-2012, 04:20 AM   #1
kazeopeia
LQ Newbie
 
Registered: Sep 2011
Posts: 10

Rep: Reputation: Disabled
How to password protect an existing file in linux using java


Hi all,

My original goal was to generate a password protected .xls file using Jasperreports. I was able to do the generation of said file. The problem is the "password protecting" part. I can't seem to find any tool or Api that would do the trick and that linux would accept.

So now I am hoping to find a way to password protect an existing file (any file) in linux instead (using java codes).

Thanks in advance for any suggestion that you could come up with. Please please do help. Thank you.
 
Old 12-03-2012, 04:36 AM   #2
pan64
Senior Member
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 4,837

Rep: Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287
how about using gzip with password protection or similar tool?
 
Old 12-03-2012, 06:02 AM   #3
dwhitney67
Senior Member
 
Registered: Jun 2006
Location: Maryland
Distribution: Kubuntu, Fedora, RHEL
Posts: 1,522

Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
Quote:
Originally Posted by kazeopeia View Post
So now I am hoping to find a way to password protect an existing file (any file) in linux instead (using java codes).
What exactly do you mean by "password protect"? Do you want only certain user (or a group of users) to have access to the file based on file permission settings, or do you wish for them to have to enter a 'password' before they are granted access? Perhaps you interested in encrypting the contents of the file? If the latter, look into the javax.crypto package.

It would be helpful if you clarify exactly what you require.
 
Old 12-03-2012, 08:55 AM   #4
kazeopeia
LQ Newbie
 
Registered: Sep 2011
Posts: 10

Original Poster
Rep: Reputation: Disabled
Thanks for the responses.

@pan - I can't use gzip because that would mean storing the generated .xls file inside a zip folder. I need just the excel file itself.

@dwhitney - I don't have to encrypt the contents of the file. I just need to make the excel file itself password protected in such a way that when the user opens the file he will be prompted to enter the correct password.
 
Old 12-04-2012, 12:16 AM   #5
pan64
Senior Member
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 4,837

Rep: Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287
so try this: http://stackoverflow.com/questions/2...ted-excel-file. Have you seen this: http://jexcelapi.sourceforge.net/ ?
 
Old 12-07-2012, 04:09 AM   #6
aegisisc
LQ Newbie
 
Registered: Nov 2012
Posts: 3

Rep: Reputation: 0
Re:-

Hello Everybody.

You can easily create DMG files with the help of Disk Utility in Mac OS X 10.3 and later versions. You can easily access data from DMG files after mounting them. However, in some cases, such files can not be mounted and you can not access data from them. At this point, you may lose your valuable data and need Mac Data Recovery to retrieve the lost data.

If you have any query about java Programming are welcome.

Thanks in advance.
 
  


Reply

Tags
java


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to password protect a folder/file . I don't want to encrypt it karanace Linux - Software 2 03-02-2012 06:42 AM
Password protect a file for write access slimm609 Linux - Security 4 10-14-2008 10:41 AM
password protect a directory in Linux sailu_mvn Linux - Software 6 05-24-2006 02:20 PM
how to protect a file with password bobgodwinx Linux - Security 7 07-20-2004 08:47 AM
Looking for a way to password protect a file within my Home folder BadKarma Linux - Security 2 12-26-2003 08:13 PM


All times are GMT -5. The time now is 06:06 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration