Skip to main content

rot5, rot13, rot18, rot47 codecs.

Project description

rot-codec

rot5, rot13, rot18, rot47 codecs.

ROT5、ROT13、ROT18、ROT47 编码是一种简单的码元位置顺序替换暗码。此类编码具有可逆性,可以自我解密,主要用于应对快速浏览,或者是机器的读取,而不让其理解其意。

ROT5 是 rotate by 5 places 的简写,意思是旋转5个位置,其它皆同。下面分别说说它们的编码方式。

ROT5:只对数字进行编码,用当前数字往前数的第5个数字替换当前数字,例如当前为0,编码后变成5,当前为1,编码后变成6,以此类推顺序循环。

ROT13:只对字母进行编码,用当前字母往前数的第13个字母替换当前字母,例如当前为A,编码后变成N,当前为B,编码后变成O,以此类推顺序循环。

ROT18:这是一个异类,本来没有,它是将ROT5和ROT13组合在一起,为了好称呼,将其命名为ROT18。

ROT47:对数字、字母、常用符号进行编码,按照它们的ASCII值进行位置替换,用当前字符ASCII值往前数的第47位对应字符替换当前字符,例如当前为小写字母z,编码后变成大写字母K,当前为数字0,编码后变成符号_。用于ROT47编码的字符其ASCII值范围是33-126,具体可参考ASCII编码。

Install

pip install rot-codec

Install Commands

  • rot-codec

Register To System Codecs

  • rot5
  • rot13 # override the system default rot13
  • rot18
  • rot47

rot-codec Command Line Tool

Command Help

E:\rot-codec>rot-codec --help
Usage: rot-codec [OPTIONS] [MESSAGE]

ROT5、ROT13、ROT18、ROT47
编码是一种简单的码元位置顺序替换暗码。此类编码具有可逆性,可以自我解密,主要用于应对快速浏览,或者是机器的读取,而不让其理解其意。

ROT5 是 rotate by 5 places 的简写,意思是旋转5个位置,其它皆同。下面分别说说它们的编码方式。

ROT5:只对数字进行编码,用当前数字往前数的第5个数字替换当前数字,例如当前为0,编码后变成5,当前为1,编码后变成6,以此类推顺序循环。

ROT13:只对字母进行编码,用当前字母往前数的第13个字母替换当前字母,例如当前为A,编码后变成N,当前为B,编码后变成O,以此类推顺序循环。

ROT18:这是一个异类,本来没有,它是将ROT5和ROT13组合在一起,为了好称呼,将其命名为ROT18。

ROT47:对数字、字母、常用符号进行编码,按照它们的ASCII值进行位置替换,用当前字符ASCII值往前数的第47位对应字符替换当前字符,例如当前
为小写字母z,编码后变成大写字母K,当前为数字0,编码后变成符号_。用于ROT47编码的字符其ASCII值范围是33-126,具体可参考ASCII编
码。

备注:MESSAGE为提供时,则从STDIN中读取。

Options:
-m, --method [rot5|rot13|rot18|rot47]
-d, --decode
-e, --encoding TEXT             Message encoding.
--help                          Show this message and exit.

Usage

E:\rot-codec>rot-codec hello
uryyb

E:\rot-codec>rot-codec -d uryyb
hello

Releases

v0.1.3

  • Doc update.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rot_codec-0.1.3.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rot_codec-0.1.3-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file rot_codec-0.1.3.tar.gz.

File metadata

  • Download URL: rot_codec-0.1.3.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for rot_codec-0.1.3.tar.gz
Algorithm Hash digest
SHA256 23fb7fd83b2d0aac8be520a93300f1607a1b6f6ae2f1b70343d64930e8b2da5d
MD5 ceb1c3186fb4e1354f35d49841ae6cf4
BLAKE2b-256 c2dc9bdd94d57e0c93e3761e67191e3fd5321fd71d768a55c936bf65d0b48da3

See more details on using hashes here.

File details

Details for the file rot_codec-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: rot_codec-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for rot_codec-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 dc3005598d0015d55c575b4af7923e1a54d859d8c48fe58a5a65f2226833bf58
MD5 b2899a6cd5b174318f78859a238c4ce0
BLAKE2b-256 3c031fe7f275660d98b636aa7d6a39823a526273ddc2223b08e38edc2e73ce9e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page