File security System in java? -
i'm new java world.i have idea file secure system.when add file application encrypt , store folder in installation path.if need see file ,i need login username , password , file automatically decrypted folder. think can encrypt file using aes or des can't access these folder outside. problem can these things using java,if can give me suggestions please???
so encrypt aspect of file may want gather it's bytes in array*, can either done using class files java or stream manually. lets got byte array obtained using files.readallbytes(path file); use whatever encryption want these bytes. write them file using stream.
thats encryption.
*the flaw of code above loads byte array straight on memory. thats fine if file few kb otherwise verry resource consuming , may lead "outofmemoryexception". avoid may want have 2 streams, 1 read , write, read byte or chunk of bytes file, encrypt it/them , use output stream write file.
the login simple handle (depending on aproach) both console , gui aplications. if username , password variables in aplication , check if input matches them, thats fine if want active registrations , on need file(s) hold theese details. in case username , password can obtained decompiling program or deserialising serialised data.
so answer last part of question, yes can java :- )
Comments
Post a Comment