NewStar 2024-Crypto-Week 1

XOR

  • XOR是异或,具有如下特性
c = m xor key
m = c xor key
  • 根据题目给出的加密文件,可以再次操作得到c2的明文m2u_know_XOR!}
  • 根据前半段加密,写出如下解密脚本
from Crypto.Util.number import long_to_bytes,bytes_to_long
key = b'New_Star_CTF'
key_b = bytes_to_long(key)
c = 8091799978721254458294926060841
m = c ^ key_b
m = long_to_bytes(m)
print(m)
  • 合并得到flag{0ops!_you_know_XOR!}

Base

  • CyberChef魔法棒,十六进制转文本,base32,base64
  • flag{B@sE_0f_CrYpt0_N0W}

一眼秒了

  • 这是道RSA题
  • RSA Tool 2工具尝试分解n失败
  • 网站分解
  • 得到p,q
  • 带入RSA Tool 2,或者手写脚本,我选择手写
from Crypto.Util.number import *

n = 52147017298260357180329101776864095134806848020663558064141648200366079331962132411967917697877875277103045755972006084078559453777291403087575061382674872573336431876500128247133861957730154418461680506403680189755399752882558438393107151815794295272358955300914752523377417192504702798450787430403387076153
p = 7221289171488727827673517139597844534869368289455419695964957239047692699919030405800116133805855968123601433247022090070114331842771417566928809956044421
q = 7221289171488727827673517139597844534869368289455419695964957239047692699919030405800116133805855968123601433247022090070114331842771417566928809956045093
e = 65537
c = 48757373363225981717076130816529380470563968650367175499612268073517990636849798038662283440350470812898424299904371831068541394247432423751879457624606194334196130444478878533092854342610288522236409554286954091860638388043037601371807379269588474814290382239910358697485110591812060488786552463208464541069
d = inverse(e,(p-1)*(q-1))
m = pow(c,d,n)
print(m)
print(hex(m))
  • 输出十六进制,用CyberChef处理得到flag
  • flag{9cd4b35a-affc-422a-9862-58e1cc3ff8d2}

Strange King

  • 尝试用quipquip.com,设置ksjr = flag,发现没有可读明文
  • 用凯撒枚举解密,发现flag每偏移量+2依次出现
  • 猜测偏移量依次往后+2
  • 手写脚本
alpha1 = 'abcdefghijklmnopqrstuvwxyz'
alpha2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
c = 'ksjr{EcxvpdErSvcDgdgEzxqjql}'
ans = ''
n = 5
for i in c:
    if i in alpha1:
        ans += alpha1[(alpha1.find(i)-n)%26]
    elif i in alpha2:
        ans += alpha2[(alpha2.find(i)-n)%26]
    else:
        ans += i
    n += 2
print(ans)
  • 得到明文,且可读
  • flag{PleaseDoNotStopLearing}
暂无评论

发送评论 编辑评论

|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇