One time pad- XORing or substitution I have come across 2 versions of otp while reading it and want to confirm it.


they have taken a plain text consisting of alphabets where they are
shifted and replaced by alphabets itself.
XORing of binary I/P streams with binary key.


Are they both valid forms? When I/P is in alphabets, shouldn't we convert it into binary form and then perform XORing with key?
According to the definition on Wikipedia, both are valid uses of the term "one time pad" - "each bit or character of the plaintext is encrypted by combining it with the corresponding bit or character from the pad using modular addition." - that is: e=(d+p)%m, where e=encrypted data, d=decrypted data (input), p=pad, m is the number of possible values in e, d, and p (which must be the same). % is modulus - divide (d+p) by m, but take the remainder.

The most common implementation is the XOR method, which is the above calculation using m=2 (since 1 bit has two different possible values). A byte-by-byte solution would be equally valid, with m=256. letter by letter (m=26) is fine PROVIDED only encrypted data is sent - if you use this but send punctuation, capitals, newlines, and spaces unencrypted (or encrypted as a separate character set, then this is no longer secure (it will leak data - e.g. word lengths, and position and likely candidates for proper nouns, etc.).

Remember also, the pad needs to be really, really random, and of the same length (at least) as the message. It can never be reused. If the pad is English text, it is very insecure.