DNK
Материал из InformationSecurity WIKI
Шифр Триплет/ДНК - шифрование кода молекулы ДНК.
Содержание
Чем выделяется
Где часто используется
Используется только на CTF в тасках. Так как шифр Цезаря один из самых древних, то обычно в описании заданий присутствуют на это намеки.
Скрипты
python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
ru_alph = ["CDS","CDI","FAS","CDA","CSA","CWE","CWQ","CWR","CWT","CXZ","CVZ","CVS","CBZ","CBA","CFA","FDA","FNA","FSA","FBR","FNT","FKL","FGT","FGA","FHA","CLA","CLS","CLD","CLQ","CLZ","CBY","CBP","CBN","CBI"]
ru_alph_decr = ["А","Б","В","Г","Д","Е","Ё","Ж","З","И","Й","К","Л","М","Н","О","П","Р","С","Т","У","Ф","Х","Ц","Ч","Ш","Щ","Ъ","Ы","Ь","Э","Ю","Я"]
en_alph = ["CGA","CGD","CGS","CGB","CGM","CTA","CTW","CTY","CTU","CTK","CTP","CRT","CRA","CRQ","CRF","CRG","CRD","CRG","CRH","CGJ","CRL","CRX","CRB","CPQ","CPW","CPE"]
en_alph_decr = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
symbols = ["CXG","CXP","ZXC","ZSX","ZVI","ZVA","ZBA","ZVS","ZVQ","ZVW","ZVE","ZVL","ZXQ","ZXW","ZXR","ZXT","ZXP","ZXL","ZXK","ZXJ","ZXG","ZXF","ZXD","ZXA","ZXM","ZXN","ZXN","ZXV","ZMA","ZMQ","ZME","ZMR","ZMT","ZMU"]
symbols_decr = list("!@#$%^_;()/\\=:'")+["№"]+list("\"';{}[]<>?.,-_+~| ")
numbers = ["CMQ","CXT","CXY","CXV","CIO","CXL","CXK","CXJ","CXN","CXD"]
numbers_decr = list("0123456789")
enc = ru_alph + en_alph + symbols + numbers
dec = ru_alph_decr + en_alph_decr + symbols_decr + numbers_decr
to_decode = "CDSCGSZVA"
if (len(to_decode) % 3 != 0): exit("Must divide by 3!\n")
n = 3
to_decode = [to_decode[i:i+n] for i in range(0, len(to_decode), n)]
x = 0
while (x < len(to_decode)):
to_decode[x] = dec[enc.index(to_decode[x])]
x+=1
print("".join(to_decode))
perl
ruby
java
Утилиты
Windows утилита для расшифровки