Question: / * Given a Scanner object and a PrintWriter object, copy to the latter the first four lines of the former. * / static void

/* Given a Scanner object and a PrintWriter object, copy to the latter
the first four lines of the former.
*/
static void processHeader(Scanner s, PrintWriter w) throws Exception
{
/* To be completed */
}// processHeader method
Given a file name (with no extension) for a PGM image and an
AES key (in hex format), encrypt the image using AES in ECB
mode and store the result in a file whose name is obtained by
adding to the input file name the string "_ECB" + EXT.
*/
static void encryptECB(String filename, String key)
{
/* To be completed */
}// encryptECB method
/* Given a file name (with no extension) of an encrypted PGM image
and an AES key (in hex format), decrypt the image using AES in
ECB mode and store the result in a file whose name is obtained
by adding to the input file name the string "_dec" + EXT.
*/
static void decryptECB(String filename, String key)
{
/* To be completed */
// decryptECB method
/* given two bit strings of the same length (represented as int
* arrays whose elements are 0 or 1), return the bit string containing
* the bitwise XOR of the inputs.
*/
static int[] xor(int[] s1, int[] s2)
{
int[] returnMe = new int[128];
for(int i =0; i s1.length; i++){
returnMe[i]= s1[i]^ s2[i];
}
return returnMe;
}// xor method
/* Given a 32-character hex string, return the corresponding
*128-bit string represented as an int array in which each
* element is either 0 or 1.
*/
static int[] hexStringToBits(String hex)
{
return stateToBits(AES.hexStringToByteArray(hex));
}// hexStringToBits method
/* Given a file name (with no extension) for a PGM image, an AES
* key and an initialization vector (both in hex format), encrypt
* the image using AES in CBC mode and store the result in a file
* whose name is obtained by adding to the input file name the
* string "_CBC"+ EXT.
*/
static void encryptCBC(String filename, String key, String IV)
{
/* To be completed */
}// encryptCBC method
/* Given a file name (with no extension) for an AES-encrypted PGM
* image, an AES key and an initialization vector (both in hex
* format), decrypt the image using AES in CBC mode and store the
* result in a file whose name is obtained by adding to the input
* file name the string "_dec" + EXT.
*/
static void decryptCBC(String filename, String key, String IV)
{
/* To be completed */
}// decryptCBC method
/* Given a file name (with no extension) for a PGM image, an AES
* key and an initial counter value (both in hex format), encrypt
* the image using AES in CTR mode and store the result in a file
* whose name is obtained by adding to the input file name the
* string "_CTR"+ EXT.
*/
static void encryptCTR(String filename, String key, String counter)
{
/* To be completed */
}// encryptCTR method
/* Given a file name (with no extension) for an AES-encrypted PGM
* image, an AES key and an initialization vector (both in hex
* format), decrypt the image using AES in CTR mode and store the
* result in a file whose name is obtained by adding to the input
* file name the string "_dec" + EXT.
*/
static void decryptCTR(String filename, String key, String counter)
{
/* To be completed */
}// decryptCTR method
/ * Given a Scanner object and a PrintWriter

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!