2 ms·
Distributing a OTP encrypted ciphertext ahead of time doesn't accomplish anything because the ciphertext can be translated into any plaintext you want by choosi
by harryh 14y ago
Distributing a OTP encrypted ciphertext ahead of time doesn't accomplish anything because the ciphertext can be translated into any plaintext you want by choosing the correct key.
- harryh 14y agoA practical demonstration of this BTW (in scala): def otp(s: String, key: String): String = { def base64decode(s: String): String = { new String(new sun.misc.BASE64Decoder().decodeBuffer(s)) } def xor(a: Char, b: Char): Char = (a ^ b).toChar val s2 = base64decode(s) val k2 = base64decode(key) val sb = new StringBuilder() for (i <- 0 to s2.length - 1) { sb.append(xor(s2(i), k2(i))) } sb.toString } val ciphertext = "LQcGRC0HFR4ME0sjHhkOHBVSGB0ZGhIcWRUPQgsNFkYIHwdE" val key1 = "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXphYmNkZWZnaGlq" val key2 = "eW9jZF5vemoscCpOezlobno/OGlxfzJ7K3R8MXItfShnaGtq" otp(ciphertext, key1) otp(ciphertext, key2) So releasing the ciphertext into the wild accomplishes nothing.