๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

Caesar Cipher1

[Dreamhack] Basic_Crypto1 ๋“œ๋ฆผํ•ต ์›Œ๊ฒŒ์ž„ ๋ฌธ์ œ ํ’€์ด โค๏ธ Basic_Crypto1 ๋“œ๋ฆผํ•ต ์›Œ๊ฒŒ์ž„ ๋ฌธ์ œ ํ’€์ด 1. ๋ฌธ์ œ์— ๋Œ€ํ•œ ์„ค๋ช…์„ ์ฝ์€ ํ›„ ๋ฌธ์ œ ํŒŒ์ผ ๋‹ค์šด๋กœ๋“œ ++ Roman Emperor's Cipher (์‹œ์ € ์•”ํ˜ธ๋ž€?) ์‹œ์ € ์•”ํ˜ธ(Caesar cipher)๋Š” ๊ฐ€์žฅ ๊ฐ„๋‹จํ•œ ๋Œ€์น˜ ์•”ํ˜ธ(substitution cipher) ์ค‘ ํ•˜๋‚˜๋กœ, ๋กœ๋งˆ์˜ ํ™ฉ์ œ ์‹œ์ €๊ฐ€ ์‚ฌ์šฉํ–ˆ๋‹ค๊ณ  ์ „ํ•ด์ง€๋Š” ์•”ํ˜ธํ™” ๋ฐฉ๋ฒ•์ด๋‹ค. ์‹œ์ € ์•”ํ˜ธ(Caesar cipher)๋Š” ๊ฐ ๊ธ€์ž๋ฅผ ์ผ์ •ํ•œ ๊ฑฐ๋ฆฌ๋งŒํผ ๋ฐ€์–ด์„œ ์•”ํ˜ธํ™”ํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ์ž‘๋™ํ•˜๋ฉฐ, ์•”ํ˜ธํ™” ๋ฐ ๋ณตํ˜ธํ™” ๊ณต์‹์€ ์•„๋ž˜์™€ ๊ฐ™๋‹ค. ๊ณต์‹์—์„œ n์€ ์•”ํ˜ธํ‚ค๋ฅผ, x ๋Š” ํ‰๋ฌธ ์•ŒํŒŒ๋ฒณ์˜ ์œ„์น˜(0 ~ 25)๋ฅผ ๋‚˜ํƒ€๋‚ธ๋‹ค. ์•”ํ˜ธํ™” ๋ณตํ˜ธํ™” E(x) = (x + n) % 26 D(x) = (x - n + 26) % 26 2. ๋‹ค์šด๋ฐ›์€ encode.txt ํŒŒ์ผ ์˜คํ”ˆ --> .. 2023. 8. 16.