Domanda

I am currently study on AES, There are several good site explaining and giving example about AES Encryption in java such as this. Example show AES encrypt String into byte.

My question is how to convert application such as exe, txt and mp3? I understand i have to convert the application into byte before encryption can be implement but how do you achieve that?

The SO here and here explain about encrypt executable file but does not answer my question.

È stato utile?

Soluzione 3

You may use NIO2 for random access files. This will represent the file data with a ByteBuffer. This is generally more efficient than using streams. The Java encryption classes happily accommodate you by supplying encryption methods on ByteBuffer - update and doFinal specifically.

Altri suggerimenti

FileInputStream reads files into byte arrays.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top