【SWPUCTF 2023 秋季新生赛】Classical Cipher

题目描述

一只兔子翻过5层栅栏去找base玩

U2FsdGVkX19aQNEomnRqmmLlI9qJkzr0pFMeMBF99ZDKTF3CojpkTzHxLcu/ZNCYeeAV3/NEoHhpP5QUCK5Ac+HJlZBMGdKDYwko5+sAATQ=

思路

先通过密码格式判断为Rabbit,先进行解密,根据题目提示,先进行栅栏解密再进行base64解密。

EXP

不断增加栅栏的栏数,并进行base64尝试(要去掉出现的@)

得到答案

NSSCTF{Welc0me_t0_the_w0rld_0f_crypt0graphy!!!}

### Cipher CTF Challenge Solutions and Explanations In the realm of Capture the Flag (CTF) competitions, cipher challenges often involve classical cryptography techniques that test participants' understanding of encryption methods from historical contexts to modern adaptations. Here are some detailed explanations regarding specific ciphers mentioned: #### Caesar Cipher Challenges The Caesar cipher is one of the simplest forms of substitution ciphers where each letter in the plaintext shifts a certain number of places down or up the alphabet[^1]. For example, with a shift of 3, A would be replaced by D, B would become E, and so on. To solve such puzzles within CTFs: ```python def caesar_cipher(text, shift): result = "" for i in range(len(text)): char = text[i] if char.isalpha(): ascii_offset = ord('a') if char.islower() else ord('A') shifted_char = chr((ord(char) - ascii_offset + shift) % 26 + ascii_offset) result += shifted_char else: result += char return result ``` This function can both encode and decode messages depending upon whether you add or subtract the `shift` value when calling it. #### Atbash Cipher Puzzles An interesting variant found frequently in these contests includes reversing alphabets entirely as seen through an Atbash cipher approach[^2], which maps 'A' to 'Z', 'B' to 'Y', etc., without any shifting involved but rather direct reversal mapping between characters at opposite ends of the English alphabet sequence. For handling this type of puzzle programmatically: ```python import string def atbash_cipher(message): letters = string.ascii_lowercase trans = str.maketrans(letters, letters[::-1]) return message.translate(trans) print(atbash_cipher("hello")) # svool ``` Such scripts provide efficient ways to tackle common cryptographic tasks encountered during CTF events while also serving educational purposes about traditional coding practices used historically before digital computers came into existence.
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值