#C4581. Binary Encryption
Binary Encryption
Binary Encryption
You are given a string message and must encrypt it following a specific algorithm. For each character in the string, first determine its ASCII value. Then, convert this value into its 8-bit binary representation. Concatenate all these binary strings to create a long binary string. Next, split this binary string into 8-bit segments (from left to right). If the last segment is less than 8 bits, pad it with trailing zeros to reach 8 bits. Finally, convert each 8-bit segment back to its ASCII character. Mathematically, for each character (c) in the string, its binary representation is given by:
[ \text{binary}(c) = \text{format}(\operatorname{ord}(c),\ '08b') ]
Despite the multiple steps, the final encrypted message will be identical to the input string. Your task is to implement this encryption process exactly as described.
inputFormat
The input consists of a single line containing the string message. The message may include spaces and special characters.
outputFormat
Output the encrypted message obtained after processing the input string with the described algorithm.## sample
Hi
Hi