Differences between Fprint/Fprintf vs conn.Write in GOLANG : Trying to send encrypted data across a TCP connection. Fprintf works fine for unencrypted data but seems to be adding formatting to encrypted data causing the decrypt to fail intermittently. I am unable send using conn.Write or for that matter writer.Writestring followed by writer.Flush().

		scanner := bufio.NewScanner(os.Stdin)
		for scanner.Scan() && err == nil {
			msg := scanner.Text()
				ciphertext := md5.Encrypt([]byte(msg+"\n")
				conn.Write(append(ciphertext, '\r'))
		}
			
		//Receiver
		scanner := bufio.NewScanner(conn)
			for scanner.Scan() {
			ciphertext := scanner.Bytes()
			plaintext := md5.Decrypt(ciphertext)
			fmt.Println(string(plaintext))
			}

 Suggestions welcome.
