def convertMessagetoBinaryString(input):
    """convert ascii string or raw bytes (depending on if it is an ascii string) to string containing binary representation"""
    #take each character and pad to be 8 bits, add to output string and return entire string.
    output = ""
    if input.isascii():
        input = input.encode("ascii")
    for char in input:
        output += bin(char)[2:].zfill(8)
    return output