본문 바로가기

Cryptography

[HackCTF] Classic Cipher -4

ciphertextOriginal Text

더보기

◆□ &↔↙■◀→○↔☆■●↙, ☆ 〓★#〓◀◆◀★◀◆→□ &◆■●§↔ ◆〓 ☆ ◎§◀●→@ →※ §□&↔↙■◀◆□○ #↙ ♩●◆&● ★□◆◀〓 →※ ■▼☆◆□◀§♪◀ ☆↔§ ↔§■▼☆&§@ ♩◆◀● &◆■●§↔◀§♪◀, ☆&&→↔@◆□○ ◀→ ☆ ※◆♪§@ 〓↙〓◀§◎; ◀●§ "★□◆◀〓" ◎☆↙ #§ 〓◆□○▼§ ▼§◀◀§↔〓 (◀●§ ◎→〓◀ &→◎◎→□), ■☆◆↔〓 →※ ▼§◀◀§↔〓, ◀↔◆■▼§◀〓 →※ ▼§◀◀§↔〓, ◎◆♪◀★↔§〓 →※ ◀●§ ☆#→♬§, ☆□@ 〓→ ※→↔◀●. ◀●§ ↔§&§◆♬§↔ @§&◆■●§↔〓 ◀●§ ◀§♪◀ #↙ ■§↔※→↔◎◆□○ ◀●§ ◆□♬§↔〓§ 〓★#〓◀◆◀★◀◆→□.

〓★#〓◀◆◀★◀◆→□ &◆■●§↔〓 &☆□ #§ &→◎■☆↔§@ ♩◆◀● ◀↔☆□〓■→〓◆◀◆→□ &◆■●§↔〓. ◆□ ☆ ◀↔☆□〓■→〓◆◀◆→□ &◆■●§↔, ◀●§ ★□◆◀〓 →※ ◀●§ ■▼☆◆□◀§♪◀ ☆↔§ ↔§☆↔↔☆□○§@ ◆□ ☆ @◆※※§↔§□◀ ☆□@ ★〓★☆▼▼↙ ↓★◆◀§ &→◎■▼§♪ →↔@§↔, #★◀ ◀●§ ★□◆◀〓 ◀●§◎〓§▼♬§〓 ☆↔§ ▼§※◀ ★□&●☆□○§@. #↙ &→□◀↔☆〓◀, ◆□ ☆ 〓★#〓◀◆◀★◀◆→□ &◆■●§↔, ◀●§ ★□◆◀〓 →※ ◀●§ ■▼☆◆□◀§♪◀ ☆↔§ ↔§◀☆◆□§@ ◆□ ◀●§ 〓☆◎§ 〓§↓★§□&§ ◆□ ◀●§ &◆■●§↔◀§♪◀, #★◀ ◀●§ ★□◆◀〓 ◀●§◎〓§▼♬§〓 ☆↔§ ☆▼◀§↔§@.

◀●§↔§ ☆↔§ ☆ □★◎#§↔ →※ @◆※※§↔§□◀ ◀↙■§〓 →※ 〓★#〓◀◆◀★◀◆→□ &◆■●§↔. ◆※ ◀●§ &◆■●§↔ →■§↔☆◀§〓 →□ 〓◆□○▼§ ▼§◀◀§↔〓, ◆◀ ◆〓 ◀§↔◎§@ ☆ 〓◆◎■▼§ 〓★#〓◀◆◀★◀◆→□ &◆■●§↔; ☆ &◆■●§↔ ◀●☆◀ →■§↔☆◀§〓 →□ ▼☆↔○§↔ ○↔→★■〓 →※ ▼§◀◀§↔〓 ◆〓 ◀§↔◎§@ ■→▼↙○↔☆■●◆&. ☆ ◎→□→☆▼■●☆#§◀◆& &◆■●§↔ ★〓§〓 ※◆♪§@ 〓★#〓◀◆◀★◀◆→□ →♬§↔ ◀●§ §□◀◆↔§ ◎§〓〓☆○§, ♩●§↔§☆〓 ☆ ■→▼↙☆▼■●☆#§◀◆& &◆■●§↔ ★〓§〓 ☆ □★◎#§↔ →※ 〓★#〓◀◆◀★◀◆→□〓 ☆◀ @◆※※§↔§□◀ ■→〓◆◀◆→□〓 ◆□ ◀●§ ◎§〓〓☆○§, ♩●§↔§ ☆ ★□◆◀ ※↔→◎ ◀●§ ■▼☆◆□◀§♪◀ ◆〓 ◎☆■■§@ ◀→ →□§ →※ 〓§♬§↔☆▼ ■→〓〓◆#◆▼◆◀◆§〓 ◆□ ◀●§ &◆■●§↔◀§♪◀ ☆□@ ♬◆&§ ♬§↔〓☆.

☆▼◀●→★○● ◀●§ ◀↔☆@◆◀◆→□☆▼ △§↙♩→↔@ ◎§◀●→@ ※→↔ &↔§☆◀◆□○ ☆ ◎◆♪§@ 〓★#〓◀◆◀★◀◆→□ ☆▼■●☆#§◀ ◆〓 〓◆◎■▼§, ☆ 〓§↔◆→★〓 @◆〓☆@♬☆□◀☆○§ ◆〓 ◀●☆◀ ◀●§ ▼☆〓◀ ▼§◀◀§↔〓 →※ ◀●§ ☆▼■●☆#§◀ (♩●◆&● ☆↔§ ◎→〓◀▼↙ ▼→♩ ※↔§↓★§□&↙) ◀§□@ ◀→ 〓◀☆↙ ☆◀ ◀●§ §□@. ☆ 〓◀↔→□○§↔ ♩☆↙ →※ &→□〓◀↔★&◀◆□○ ☆ ◎◆♪§@ ☆▼■●☆#§◀ ◆〓 ◀→ ■§↔※→↔◎ ☆ &→▼★◎□☆↔ ◀↔☆□〓■→〓◆◀◆→□ →□ ◀●§ →↔@◆□☆↔↙ ☆▼■●☆#§◀ ★〓◆□○ ◀●§ △§↙♩→↔@, #★◀ ◀●◆〓 ◆〓 □→◀ →※◀§□ @→□§.

☆▼◀●→★○● ◀●§ □★◎#§↔ →※ ■→〓〓◆#▼§ △§↙〓 ◆〓 ♬§↔↙ ▼☆↔○§, ◀●◆〓 &◆■●§↔ ◆〓 □→◀ ♬§↔↙ 〓◀↔→□○, ☆□@ ◆〓 §☆〓◆▼↙ #↔→△§□. ■↔→♬◆@§@ ◀●§ ◎§〓〓☆○§ ◆〓 →※ ↔§☆〓→□☆#▼§ ▼§□○◀● (〓§§ #§▼→♩), ◀●§ &↔↙■◀☆□☆▼↙〓◀ &☆□ @§@★&§ ◀●§ ■↔→#☆#▼§ ◎§☆□◆□○ →※ ◀●§ ◎→〓◀ &→◎◎→□ 〓↙◎#→▼〓 #↙ ☆□☆▼↙☎◆□○ ◀●§ ※↔§↓★§□&↙ @◆〓◀↔◆#★◀◆→□ →※ ◀●§ &◆■●§↔◀§♪◀. ◀●◆〓 ☆▼▼→♩〓 ※→↔◎☆◀◆→□ →※ ■☆↔◀◆☆▼ ♩→↔@〓, ♩●◆&● &☆□ #§ ◀§□◀☆◀◆♬§▼↙ ※◆▼▼§@ ◆□, ■↔→○↔§〓〓◆♬§▼↙ §♪■☆□@◆□○ ◀●§ (■☆↔◀◆☆▼) 〓→▼★◀◆→□ (〓§§ ※↔§↓★§□&↙ ☆□☆▼↙〓◆〓 ※→↔ ☆ @§◎→□〓◀↔☆◀◆→□ →※ ◀●◆〓). ◆□ 〓→◎§ &☆〓§〓, ★□@§↔▼↙◆□○ ♩→↔@〓 &☆□ ☆▼〓→ #§ @§◀§↔◎◆□§@ ※↔→◎ ◀●§ ■☆◀◀§↔□ →※ ◀●§◆↔ ▼§◀◀§↔〓; ※→↔ §♪☆◎■▼§, ☆◀◀↔☆&◀, →〓〓§→★〓, ☆□@ ♩→↔@〓 ♩◆◀● ◀●→〓§ ◀♩→ ☆〓 ◀●§ ↔→→◀ ☆↔§ ◀●§ →□▼↙ &→◎◎→□ §□○▼◆〓● ♩→↔@〓 ♩◆◀● ◀●§ ■☆◀◀§↔□ ☆##&☆@#. ◎☆□↙ ■§→■▼§ 〓→▼♬§ 〓★&● &◆■●§↔〓 ※→↔ ↔§&↔§☆◀◆→□, ☆〓 ♩◆◀● &↔↙■◀→○↔☆◎ ■★☎☎▼§〓 ◆□ ◀●§ □§♩〓■☆■§↔.

☆&&→↔@◆□○ ◀→ ◀●§ ★□◆&◆◀↙ @◆〓◀☆□&§ →※ §□○▼◆〓●, 27.6 ▼§◀◀§↔〓 →※ &◆■●§↔◀§♪◀ ☆↔§ ↔§↓★◆↔§@ ◀→ &↔☆&△ ☆ ◎◆♪§@ ☆▼■●☆#§◀ 〓◆◎■▼§ 〓★#〓◀◆◀★◀◆→□. ◆□ ■↔☆&◀◆&§, ◀↙■◆&☆▼▼↙ ☆#→★◀ 50 ▼§◀◀§↔〓 ☆↔§ □§§@§@, ☆▼◀●→★○● 〓→◎§ ◎§〓〓☆○§〓 &☆□ #§ #↔→△§□ ♩◆◀● ※§♩§↔ ◆※ ★□★〓★☆▼ ■☆◀◀§↔□〓 ☆↔§ ※→★□@. ◆□ →◀●§↔ &☆〓§〓, ◀●§ ■▼☆◆□◀§♪◀ &☆□ #§ &→□◀↔◆♬§@ ◀→ ●☆♬§ ☆ □§☆↔▼↙ ※▼☆◀ ※↔§↓★§□&↙ @◆〓◀↔◆#★◀◆→□, ☆□@ ◎★&● ▼→□○§↔ ■▼☆◆□◀§♪◀〓 ♩◆▼▼ ◀●§□ #§ ↔§↓★◆↔§@ #↙ ◀●§ &↔↙■◀☆□☆▼↙〓◀. ◀●§ ※▼☆○ ◆〓 ♩§▼&→◎§ ◀→ 〓◆◎■▼§ 〓★#〓◀◆◀★◀◆→□ &◆■●§↔!

 

Author : JSec

I found some weird things. for the reason of convenience, I will change these next symbols to alphabets like :

◆ = a, □ = b, & = c, ↔ = d, ↙ = e ...

The amount of the ciphertexts symbol is 39. but I can found numbers and few symbols like . or , (which looks like not encrypted) after I delete those symbols. Only 26 kinds of symbols are left.

 

Next is the refined text :

더보기

AB CDEFGHIDJFKE, J LMNLGAGMGAHB CAFKOD AL J POGKHQ HR OBCDEFGABI NE SKACK MBAGL HR FTJABGOUG JDO DOFTJCOQ SAGK CAFKODGOUG, JCCHDQABI GH J RAUOQ LELGOPV GKO "MBAGL" PJE NO LABITO TOGGODL (GKO PHLG CHPPHB), FJADL HR TOGGODL, GDAFTOGL HR TOGGODL, PAUGMDOL HR GKO JNHWO, JBQ LH RHDGK. GKO DOCOAWOD QOCAFKODL GKO GOUG NE FODRHDPABI GKO ABWODLO LMNLGAGMGAHB.

LMNLGAGMGAHB CAFKODL CJB NO CHPFJDOQ SAGK GDJBLFHLAGAHB CAFKODL. AB J GDJBLFHLAGAHB CAFKOD, GKO MBAGL HR GKO FTJABGOUG JDO DOJDDJBIOQ AB J QARRODOBG JBQ MLMJTTE XMAGO CHPFTOU HDQOD, NMG GKO MBAGL GKOPLOTWOL JDO TORG MBCKJBIOQ. NE CHBGDJLG, AB J LMNLGAGMGAHB CAFKOD, GKO MBAGL HR GKO FTJABGOUG JDO DOGJABOQ AB GKO LJPO LOXMOBCO AB GKO CAFKODGOUG, NMG GKO MBAGL GKOPLOTWOL JDO JTGODOQ.

GKODO JDO J BMPNOD HR QARRODOBG GEFOL HR LMNLGAGMGAHB CAFKOD. AR GKO CAFKOD HFODJGOL HB LABITO TOGGODL, AG AL GODPOQ J LAPFTO LMNLGAGMGAHB CAFKODV J CAFKOD GKJG HFODJGOL HB TJDIOD IDHMFL HR TOGGODL AL GODPOQ FHTEIDJFKAC. J PHBHJTFKJNOGAC CAFKOD MLOL RAUOQ LMNLGAGMGAHB HWOD GKO OBGADO POLLJIO, SKODOJL J FHTEJTFKJNOGAC CAFKOD MLOL J BMPNOD HR LMNLGAGMGAHBL JG QARRODOBG FHLAGAHBL AB GKO POLLJIO, SKODO J MBAG RDHP GKO FTJABGOUG AL PJFFOQ GH HBO HR LOWODJT FHLLANATAGAOL AB GKO CAFKODGOUG JBQ WACO WODLJ.

JTGKHMIK GKO GDJQAGAHBJT YOESHDQ POGKHQ RHD CDOJGABI J PAUOQ LMNLGAGMGAHB JTFKJNOG AL LAPFTO, J LODAHML QALJQWJBGJIO AL GKJG GKO TJLG TOGGODL HR GKO JTFKJNOG (SKACK JDO PHLGTE THS RDOXMOBCE) GOBQ GH LGJE JG GKO OBQ. J LGDHBIOD SJE HR CHBLGDMCGABI J PAUOQ JTFKJNOG AL GH FODRHDP J CHTMPBJD GDJBLFHLAGAHB HB GKO HDQABJDE JTFKJNOG MLABI GKO YOESHDQ, NMG GKAL AL BHG HRGOB QHBO.

JTGKHMIK GKO BMPNOD HR FHLLANTO YOEL AL WODE TJDIO, GKAL CAFKOD AL BHG WODE LGDHBI, JBQ AL OJLATE NDHYOB. FDHWAQOQ GKO POLLJIO AL HR DOJLHBJNTO TOBIGK (LOO NOTHS), GKO CDEFGJBJTELG CJB QOQMCO GKO FDHNJNTO POJBABI HR GKO PHLG CHPPHB LEPNHTL NE JBJTEZABI GKO RDOXMOBCE QALGDANMGAHB HR GKO CAFKODGOUG. GKAL JTTHSL RHDPJGAHB HR FJDGAJT SHDQL, SKACK CJB NO GOBGJGAWOTE RATTOQ AB, FDHIDOLLAWOTE OUFJBQABI GKO (FJDGAJT) LHTMGAHB (LOO RDOXMOBCE JBJTELAL RHD J QOPHBLGDJGAHB HR GKAL). AB LHPO CJLOL, MBQODTEABI SHDQL CJB JTLH NO QOGODPABOQ RDHP GKO FJGGODB HR GKOAD TOGGODLV RHD OUJPFTO, JGGDJCG, HLLOHML, JBQ SHDQL SAGK GKHLO GSH JL GKO DHHG JDO GKO HBTE CHPPHB OBITALK SHDQL SAGK GKO FJGGODB JNNCJQN. PJBE FOHFTO LHTWO LMCK CAFKODL RHD DOCDOJGAHB, JL SAGK CDEFGHIDJP FMZZTOL AB GKO BOSLFJFOD.

JCCHDQABI GH GKO MBACAGE QALGJBCO HR OBITALK, 27.6 TOGGODL HR CAFKODGOUG JDO DOXMADOQ GH CDJCY J PAUOQ JTFKJNOG LAPFTO LMNLGAGMGAHB. AB FDJCGACO, GEFACJTTE JNHMG 50 TOGGODL JDO BOOQOQ, JTGKHMIK LHPO POLLJIOL CJB NO NDHYOB SAGK ROSOD AR MBMLMJT FJGGODBL JDO RHMBQ. AB HGKOD CJLOL, GKO FTJABGOUG CJB NO CHBGDAWOQ GH KJWO J BOJDTE RTJG RDOXMOBCE QALGDANMGAHB, JBQ PMCK THBIOD FTJABGOUGL SATT GKOB NO DOXMADOQ NE GKO CDEFGJBJTELG. GKO RTJI AL SOTCHPO GH LAPFTO LMNLGAGMGAHB CAFKOD!

 

And this is the frequency analyzed data.

In English, there's an order of frequencies(Descending order, E is most frequent): E T A O I N S H R D L C U M W F G Y P B V K J X Q Z 

 

Also, digraph, trigraph, and doubles

더보기

DIGRAPHS

The most common digraphs in the English language are:
TH,HE,AN,IN,ER,ON,RE,ED,ND,HA,AT,EN

The most common digraphs in the message are:
KO,GK,OD,GA,HB,DO,AB,GO,AG,FK

 

TRIGRAPHS

The most common trigraphs in the English language are:
THE,AND,THA,ENT,ION,TIO,FOR,NDE,HAS,NCE,TIS,OFT,MEN

The most common trigraphs in the message are:
GKO,KOD,GAH,AHB,CAF,AFK,FKO,GOD,ODL,MGA,ABI,GOU,OUG

 

DOUBLES

The most common double letters in the English language are:
SS,EE,TT,FF,LL,MM,OO

The most common double letters in the message are:
GG,LL,TT,PP,RR,OO,CC,DD,FF,JJ,HH,NN,ZZ

 

SPOILER ALERT. FLAG INCLUDED

더보기

in cryptography, a substitution cipher is a method of encrypting by which units of plaintext are replaced with ciphertext, according to a fixed systemj the "units" may be single letters (the most common), pairs of letters, triplets of letters, mixtures of the above, and so forth. the receiver deciphers the text by performing the inverse substitution.

substitution ciphers can be compared with transposition ciphers. in a transposition cipher, the units of the plaintext are rearranged in a different and usually quite complex order, but the units themselves are left unchanged. by contrast, in a substitution cipher, the units of the plaintext are retained in the same sequence in the ciphertext, but the units themselves are altered.

there are a number of different types of substitution cipher. if the cipher operates on single letters, it is termed a simple substitution cipherj a cipher that operates on larger groups of letters is termed polygraphic. a monoalphabetic cipher uses fixed substitution over the entire message, whereas a polyalphabetic cipher uses a number of substitutions at different positions in the message, where a unit from the plaintext is mapped to one of several possibilities in the ciphertext and vice versa.

although the traditional keyword method for creating a mixed substitution alphabet is simple, a serious disadvantage is that the last letters of the alphabet (which are mostly low frequency) tend to stay at the end. a stronger way of constructing a mixed alphabet is to perform a columnar transposition on the ordinary alphabet using the keyword, but this is not often done.

although the number of possible keys is very large, this cipher is not very strong, and is easily broken. provided the message is of reasonable length (see below), the cryptanalyst can deduce the probable meaning of the most common symbols by analyzing the frequency distribution of the ciphertext. this allows formation of partial words, which can be tentatively filled in, progressively expanding the (partial) solution (see frequency analysis for a demonstration of this). in some cases, underlying words can also be determined from the pattern of their lettersj for example, attract, osseous, and words with those two as the root are the only common english words with the pattern abbcadb. many people solve such ciphers for recreation, as with cryptogram puzzles in the newspaper.

according to the unicity distance of english, 27.6 letters of ciphertext are required to crack a mixed alphabet simple substitution. in practice, typically about 50 letters are needed, although some messages can be broken with fewer if unusual patterns are found. in other cases, the plaintext can be contrived to have a nearly flat frequency distribution, and much longer plaintexts will then be required by the cryptanalyst. the flag is welcome to simple substitution cipher!

 

'Cryptography' 카테고리의 다른 글

[Defend the Web] Crypt 4  (0) 2020.07.05
[Defend the Web] Crypt 3  (0) 2020.07.05
[Defend the Web] Crypt 1 & Crypt 2  (0) 2020.07.03
[HackCTF] Classic Cipher -3  (0) 2020.06.02