java - Create a password protected excel file using apache poi? -
java - Create a password protected excel file using apache poi? -
i developing simple java programme create excel file using (apache poi) api. using oracle 10g database , using ojdbc14 jar.
i have table called userinfo having 3 columns namely username,password , name.
using apache poi
, have been able set rows in excel file.
since file contain sensitive info such username , password, want create password protected. on forums , have found how read password protected files not how create them. how can accomplish this?
thanks in advance.
updated: of version 3.10 poi supports encryption decryption xlsx files. see the "encryption support" page on poi's website. below still relevant xls binary workbooks.
according the "encryption support" page on poi's website poi supports reading encrypted xls , xlsx files. encrypting not mentioned on page, implies it's not supported. backed searching poi site "encrypt" returns handful of results of decryption. i've taken @ sources crypto implementation, appears handle decryption. isn't surprising; poi designed info extraction , search indexing, not creating new spreadsheets.
as others have suggested, it's possible work around missing features in poi creating template in excel , using poi populate data. unfortunately won't work encryption because file format of encrypted spreadsheets radically different.
if you're willing pay commercial software, latest version of extenxls has total read , write back upwards encryption formats supported excel. build encryptedworkbookhandle
instead of normal workbookhandle
. utilize strongest possible cipher supported unmodified jre, rc4 xls , 128-bit aes xlsx. if want utilize 256-bit aes ooxml , you've installed jce unlimited policy can msofficeencrypter
class.
jexcelapi, popular open-source java spreadsheet api, not appear back upwards encryption @ all. aspose.cells, commercial offering, supports stong encryption. documentation actuate's e.spreadsheet seems have disappeared 'net, can't tell whether supports encryption or not.
since none of freely available java spreadsheet apis seems back upwards writing encrypted spreadsheets, if you're not willing utilize commercial software you'll need come workaround. could, example, write spreadsheet encrypted zip file. java.util.zip
doesn't back upwards encryption, looks zip4j does.
full disclosure: work extentech, company behind extenxls.
java excel apache-poi xls
Comments
Post a Comment