LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   How to password protect an existing file in linux using java (http://www.linuxquestions.org/questions/programming-9/how-to-password-protect-an-existing-file-in-linux-using-java-4175439780/)

kazeopeia 12-03-2012 04:20 AM

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.

pan64 12-03-2012 04:36 AM

how about using gzip with password protection or similar tool?

dwhitney67 12-03-2012 06:02 AM

Quote:

Originally Posted by kazeopeia (Post 4841629)
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.

kazeopeia 12-03-2012 08:55 AM

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.

pan64 12-04-2012 12:16 AM

so try this: http://stackoverflow.com/questions/2...ted-excel-file. Have you seen this: http://jexcelapi.sourceforge.net/ ?

aegisisc 12-07-2012 04:09 AM

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.


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