기본 콘텐츠로 건너뛰기

2017 암호경진대회 1번

알파벳으로 구성된 평문을 2개의 값으로 shift하는 key table로 암호화한 암호문이 주어졌을때 평문을 찾는 문제입니다.

소문제 1번은 경우 암호문길이가 길어서 풀 수 있었는데, 2번의 경우 길이가 너무 짧아 못풀었습니다.

제출한 답안 그대로 올릴겠습니다

1-1.
복구된 평문:
youneedtomanageyourresourcesspeednolongermattersitusedtobethecasethatprogramstookareallylongtimetoruncpuswereexpensivememorywasexpensiverunningtimeofaprogramusedtobeanimportantmetriccomputerswereveryexpensiveandsowastheelectricitytorunthemoptimizationoftheseresourceswasdonebecauseofaneternalbusinesslawoptimizeyourmostexpensiveresourcehistoricallythemostexpensiveresourcewascomputerruntimethisiswhatleadtothestudyofcomputersciencewhichfocusesonefficiencyofdifferentalgorithmshoweverthisisnolongertrueassiliconisnowcheaplikereallycheapruntimeisnolongeryourmostexpensiveresourceacompanysmostexpensiveresourceisnowitsemployeestimeorinotherwordsyouitsmoreimportanttogetstuffdonethantomakeitgofastinfactthisissoimportantiamgoingtoputitagainrighthereasifitwasaquoteforthosewhoarejustbrowsingitsmoreimportanttogetstuffdonethantomakeitgofastyoumightbesayingmycompanycaresaboutspeedibuildawebapplicationandallresponseshavetobefasterthanxmillisecondsorwehavehadcustomerscancelbecausetheythinkourappistooslowiamnottryingtosaythatspeeddoesntmatteratalliamsimplytryingtosaythatitsnolongerthemostimportantthingitsnotyourmostexpensiveresourcespeedspeedistheonlythingthatmatterswhenyousayspeedinthecontextofprogrammingyoutypicallymeanperformanceakacpucycleswhenyourceosaysspeedinthecontextofprogramminghemeansbusinessspeedthemostimportantmetricistimetomarketultimatelyitdoesntmatterhowfastyourproductwebappisitdoesntmatterwhatlanguageitswritteninitdoesntevenmatterhowmuchmoneyittakestorunattheendofthedaytheonethingthatwillmakeyourcompanysurviveordieistimetomarketimnotjusttalkingaboutthestartupideaofhowlongittakestillyoumakemoneybutmoresothetimeframeoffromideatocustomershandstheonlywaytosurviveinbusinessistoinnovatefasterthanyourcompetitorsitdoesntmatterhowmanygoodideasyoucomeupwithifyourcompetitorsshipbeforeyoudoyouhavetobethefirsttomarketoratleastkeepuponceyouslowdownyouaredonetheonlywaytosurviveinbusinessistoinnovatefasterthanyourcompetitorsacaseofmicroservicescompanieslikeamazongoogleandnetflixunderstandtheimportanceofmovingfasttheyhavecreatedabusinesssystemwheretheycanmovefastandinnovatequicklymicroservicesarethesolutiontotheirproblemthisarticlehasnothingtodowithwhetherornotyoushouldbeusingmicroservicesbutatleastacceptthatamazonandgooglethinktheyshouldbeusingthemmicroservicesareinherentlyslowtheveryconceptofamicroserviceistobreakupaboundarybyanetworkcallthismeansyouaretakingwhatwasafunctioncallacouplecpucyclesandturningitintoanetworkcallthereisntmuchyoucoulddothatisworseintermsofperformancenetworkcallsarereallyslowcomparedtothecpubutthesebigcompaniesstillchoosetousemicroservicestherereallyisntanarchitectureslowerthanmicroservicesthatiknowofmicroservicesbiggestconisperformancebutgreatestproistimetomarketbybuildingteamsaroundsmallerprojectsandcodebasesacompanyisabletoiterateandinnovateatamuchfasterpacethisjustgoestoshowthatverylargecompaniesalsocareabouttimetomarketnotjuststartupscpuisnotyourbottleneckifyouwriteanetworkapplicationsuchasawebserverchancesarecputimeisnotthebottleneckofyourapplicationwhenyourwebserverhandlesarequestitprobablymakesacouplenetworkcallssuchastoyourdatabaseorperhapsacacheserverlikerediswhiletheseservicesthemselvesmaybefastthenetworkcalltothemisslowthereisareallygreatblogarticleonthespeeddifferencesofcertainoperationsinthearticletheauthorscalescpucycletimesintomoreunderstandablehumantimesifasinglecpucyclewastheequivalentofonesecondthenanetworkcallfromcaliforniatonewyorkwouldbetheequivalentoffouryearsthatishowmuchslowernetworkisforsomeroughestimatesletssayanormalnetworkcallinsidethesamedatacentertakesaboutthreemsthatwouldbetheequivalentofthreemonthsinourhumanscalenowimagineyourprogramisverycpuintensiveittakesahundredthousandcyclestorespondtoasinglecallthatwouldbetheequivalentofjustoveronedaynowletssayyouusealanguagethatisfivetimesasslownowittakesaboutfivedayswellcomparethattoourthreemonthnetworkcallandthefourdaydifferencedoesntreallymattermuchatallifsomeonehastowaitatleastthreemonthsforapackageidontthinkanextrafourdayswillreallymatterallthatmuchtothemwhatthisultimatelymeansisthatevenifpythonisslowitdoesntmatterthespeedofthelanguageorcputimeisalmostnevertheissuegoogleactuallydidastudyonthisveryconceptandtheywroteapaperonitthepapertalksaboutdesigningahighthroughputsystemintheconclusiontheysayitmayseemparadoxicaltou

테이블
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
v
f
c
p
k
g
q
n
h
e
u
y
z
s
o
a
w
b
d
r
x
m
i
t
j
l

시프트 값 : 13, 21

풀이:
테이블이 n번 움직인 후에는 초기의 테이블과 같은 모양을 띌 것으로 생각했다그리고 길이 n위치마다 있는 알파벳은 같은 키테이블로 암호화되기 때문에 일반적인 알파벳의 빈도를 따를 것으로 생각했다
반복되는 길이를 추측하기 위해 암호문을 n의 길이로 나누고 같은 위치를 같은 문자끼리 합하였다
그리고 index of coincidence를 계산하였다그 결과 키 길이(테이블이 처음과 같은 상태로 돌아오는 길이)에서 일반적인 알파벳의 index of coincidence값인 0.6정도가 나왔다
이후 암호문을 26의 길이잡고 알파벳의 빈도를 분석하였다빈도 분석 후에 자주 사용되는 2글자, 3글자를 대입해봄으로써 비밀정보를 구할 수 있었다.

1-2.
답안:
문제 1-1과 같은 방법으로 접근하여 반복되는 길이가 26인 것은 확인하였으나그 외의 비밀정보는 찾지 못하였다. 1-1에 비해 주어진 데이터가 적어 구하기 못하였다.

댓글

이 블로그의 인기 게시물

2017 암호경진대회 4번

가장 쉽게 풀었죠. 30분도 안걸렸던거 같네요. 프로그램을 통해서 암호문의 유효성이 검증되는데요, 역공학을 통해서 암호문을 쉽게 찾을 수 있습니다. 답안  : Snow White and the Seven Dwarfs!. 풀이  : Oracle 함수가  CRC 를 계산하기 위해서는 중간에 평문이 복구될 것으로 보였다 .  제공하는  dll 을 이용하여  Oracle 함수의 입력으로 암호문을 넣은 프로그램을 작성하였다 . IDA 와  Immunity Debugger 를 이용해 프로그램을 역공학하여 얻을 수 있었다 .