The ROT47 (Caesar cipher by 47 chars) is a simple character substitution cipher that replaces a character within the ASCII range [33, 126] with the character 47 character after it (rotation) in the ASCII table. It is an invertible algorithm i.e. applying the same algorithm to the input twice will get the origin text.
The ROT47 can be easily implemented by modern programming language in many many ways, e.g. using a lookup table. For example, the following PHP code uses strstr to convert the text by using a lookup table.
Alternatively, ROT47 can be implemented by computing directly the ROT47-ed ASCII of each given character.
function Rot47(const s: string): string;
i, j: integer;
Result := s;
for i := 1 to Length(s) do
j := Ord(s[i]);
if (j in [33..126]) then
Result[i] := Chr(33 + ((j + 14) mod 94));