In earlier version of WTLS supported a 40bit XOR MAC and als
In earlier version of WTLS supported a 40-bit XOR MAC and also supported RC4 stream encryption. The XOR MAC works by padding the message with zeros, dividing it into 5-byte blocks and XORing these blocks together. Show that this scheme does not provide message integrity protection.
Solution
int bsdChecksumFromFile(FILE *fp) /* The file handle for computer file */
every character browse. */
int substantiation = 0; /* The substantiation mod 2^16. */
whereas ((ch = getc(fp)) != EOF) {
substantiation = (checksum >> 1) + ((checksum & 1) << 15);
substantiation += ch;
substantiation &= 0xffff; /* Keep it among bounds. */
}
come back checksum;
}
byte checksum(byte[] input) computer memory unit substantiation = 0;
for (byte cur_byte: input) {
substantiation = (byte) (((checksum & 0xFF) >>> 1) + ((checksum & 0x1) << 7)); // Rotate the accumulator
substantiation = (byte) ((checksum + cur_byte) & 0xFF); // Add consecutive chunk
}
come back checksum;
}
