2013-12-11 2 views
-2

누구든지이 암호의 이름을 알려 주실 수 있습니까?누군가이 암호의 이름을 알려주시겠습니까?

간단한 대체 암호라는 것을 알고 있습니다. 단지 그 이름을 모르겠습니다.

암호 키 :

help 

암호 알파벳 :

a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z 
h|e|l|p|a|b|c|d|f|g|i|j|k|m|n|o|q|r|s|t|u|v|w|x|y|z 

텍스트 :

this is a test 

암호 텍스트 :

tdfs fs h tast 
+5

이 질문은 것으로 보인다 오프 주제는 암호화에 관한 것입니다 및 프로그래밍 문제가 포함되어 있지 않기 때문에. –

+0

이름이 아직 지정되지 않은 경우 "Lucypher"라고 제목을 지정합니다. –

+0

카이사르 암호의 변형이지만 카이사 암호는 이와 같은 키를 사용하지 않습니다. – Chris

답변

1

간단하지 않습니다 substitution cipher? 방금 "도움"의 4 글자를 앞으로 옮기고 나머지 글자를 모두 오른쪽으로 옮겼습니다. 여기에 편집

람다, itertools 및 별표 (*) 인수 및 시간을 낭비 (아마도 파이썬에서 암호를 코딩에 흥미있는 토론을 할 수있는 것을 구출)에있는 운동으로 파이썬 구현입니다 :

import string 
from itertools import izip, count, starmap 

def cipher(s,key): 
    # characters you want to translate, e.g. 
    # 'abcd ... xyz ' 
    raw = string.ascii_lowercase + ' ' 

    # cipher with your key, e.g. 
    # 'helpabcdfgi...z ' 
    sub = key + string.translate(raw, None, key) 

    # create a dictionary from a character to an index 
    # in the original raw value string 
    m = dict(izip(raw, count())) 

    # looks up the index in the map using: starmap(m.get, s) 
    # then gets the substitution character: map(lambda i:sub[i], ...) 
    # and joins them together 
    return ''.join(map(lambda i:sub[i], starmap(m.get, s))) 

그리고 그것을 확인하기 위해 몇 가지 테스트 코드가 작동합니다

ins = 'this is a test' 
outs = cipher(ins, "help") 

print ins,' -> ',outs 

exp = "tdfs fs h tast" 
if exp == outs: 
    print "pass :)" 
else: 
    print "~~ FAIL ~~", " expected ", exp 

출력 :

D:\temp>cipher.py 
this is a test -> tdfs fs h tast 
pass :) 
+0

예, 간단히 말해 단순한 대체 암호 (카이사르 암호의 변형이라고 할 수 있습니다.)하지만이 키가 실제로 사용되는 이름인지 알고 싶었습니다. – Chris

0

나는 대답을 찾았습니다. 카이사르 변종, "혼합 알파벳"대체 암호.

간단한 예,하지만 추가 MOR 복잡성 당신은 (혼합 알파벳 및 다중 문자의 혼합물되는)이 같은 블록에 넣어 수 :

|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z 
------------------------------------------------------ 
1|h|e|l|p|a|b|c|d|f|g|I|j|k|m|n|o|q|r|s|t|u|v|w|x|y|z 
2|e|l|p|a|b|c|d|f|g|I|j|k|m|n|o|q|r|s|t|u|v|w|x|y|z|h 
3|l|p|a|b|c|d|f|g|I|j|k|m|n|o|q|r|s|t|u|v|w|x|y|z|h|e 
4|p|a|b|c|d|f|g|I|j|k|m|n|o|q|r|s|t|u|v|w|x|y|z|h|e|l 
5|a|b|c|d|f|g|I|j|k|m|n|o|q|r|s|t|u|v|w|x|y|z|h|e|l|p 
6|b|c|d|f|g|I|j|k|m|n|o|q|r|s|t|u|v|w|x|y|z|h|e|l|p|a 
7|c|d|f|g|I|j|k|m|n|o|q|r|s|t|u|v|w|x|y|z|h|e|l|p|a|b 
8|d|f|g|I|j|k|m|n|o|q|r|s|t|u|v|w|x|y|z|h|e|l|p|a|b|c 
9|f|g|I|j|k|m|n|o|q|r|s|t|u|v|w|x|y|z|h|e|l|p|a|b|c|d 
10|g|I|j|k|m|n|o|q|r|s|t|u|v|w|x|y|z|h|e|l|p|a|b|c|d|f 
11|I|j|k|m|n|o|q|r|s|t|u|v|w|x|y|z|h|e|l|p|a|b|c|d|f|g 
12|j|k|m|n|o|q|r|s|t|u|v|w|x|y|z|h|e|l|p|a|b|c|d|f|g|I 
13|k|m|n|o|q|r|s|t|u|v|w|x|y|z|h|e|l|p|a|b|c|d|f|g|I|j 
14|m|n|o|q|r|s|t|u|v|w|x|y|z|h|e|l|p|a|b|c|d|f|g|I|j|k 
15|n|o|q|r|s|t|u|v|w|x|y|z|h|e|l|p|a|b|c|d|f|g|I|j|k|m 
16|o|q|r|s|t|u|v|w|x|y|z|h|e|l|p|a|b|c|d|f|g|I|j|k|m|n 
17|q|r|s|t|u|v|w|x|y|z|h|e|l|p|a|b|c|d|f|g|I|j|k|m|n|o 
18|r|s|t|u|v|w|x|y|z|h|e|l|p|a|b|c|d|f|g|I|j|k|m|n|o|q 
19|s|t|u|v|w|x|y|z|h|e|l|p|a|b|c|d|f|g|I|j|k|m|n|o|q|r 
20|t|u|v|w|x|y|z|h|e|l|p|a|b|c|d|f|g|I|j|k|m|n|o|q|r|s 
21|u|v|w|x|y|z|h|e|l|p|a|b|c|d|f|g|I|j|k|m|n|o|q|r|s|t 
22|v|w|x|y|z|h|e|l|p|a|b|c|d|f|g|I|j|k|m|n|o|q|r|s|t|u 
23|w|x|y|z|h|e|l|p|a|b|c|d|f|g|I|j|k|m|n|o|q|r|s|t|u|v 
24|x|y|z|h|e|l|p|a|b|c|d|f|g|I|j|k|m|n|o|q|r|s|t|u|v|w 
25|y|z|h|e|l|p|a|b|c|d|f|g|I|j|k|m|n|o|q|r|s|t|u|v|w|x 
26|z|h|e|l|p|a|b|c|d|f|g|I|j|k|m|n|o|q|r|s|t|u|v|w|x|y 

이 후 오히려 Vigenere 암호 변형 더 많은 것 카이사르 암호 변형보다. 키 아직도

:

help 

같은 메시지 :

this is a test 

이 될 것입니다 :

tfiv kx c hkep 

복잡성의 또 다른 수준의 그룹이 될 것입니다 문자 중 하나를 모두 함께 또는 블록으로 :

tfivkxchkep 

(10) 또는 차단 (3 자) :

tfi 
vkx 
chk 
epz 

    With an extra z added to make up the missing character. 
관련 문제