RCTF-misc-coocat wp

coolcat writeup

I am honored to give a misc challenge for RCTF( forgive me for my poor english plz

The idea of this challenge comes from an article authored by Merricx , a crypto master
you can visit it for this link
https://merricx.github.io/dont-roll-your-own-crypto-1/

After reading this article , I tried to user a part of technique in it to make a simple challenge

If you want to learn more , you can search for knowledge about Arnold’s Cat Map

Now , I will give one solution to solved this challenge

now let’s see the source code

 def ACM(img, p, q, m):
    counter = 0

    if img.mode == "P":
        img = img.convert("RGB")

    assert img.size[0] == img.size[1]

    while counter < m:
        dim = width, height = img.size

        with Image.new(img.mode, dim) as canvas:
            for x in range(width):
                for y in range(height):
                    nx = (x + y * p) % width
                    ny = (x * q + y * (p * q + 1)) % height

                    canvas.putpixel((nx, ny), img.getpixel((x, y)))

        img = canvas
        counter += 1

    return canvas

# My image was encrypted by ACM ,  but I lost the p ,q  and m ......

lol , i made m is uncertain , so each time you get the image may be different!

As the m increase , the server takes more time to encrypt the image

so I set m random.randint(1,5) ( I think if there are too many requests , this way will be blocked , so I made m tiny , you can also get m by brute-force

get m

form the picture , you can see that Timing Attack is work
encrypt one time takes about 1.75s ,so you can get the m ! ( unfortunately , there are too many requests

在这里插入图片描述

get p,q

now we need to get p ,q
notice

在这里插入图片描述
so have two ways to get p,q

first way

We know that this encryt way is periodicity
because the m is tiny , and p ,q is certain , so you can recover the image by encrypt it over and over again

the code comes from a write up ,thanks a lot
在这里插入图片描述

second way

just to upload a one pic image with size 600x600
and you can get q,p by solving linear equations in two variables

at last

Thanks for Merricx’s great article again .
Hope you will paticipate RCTF next year and have fun again!

### 回答1: kbd-misc-2.5.1是一个Linux操作系统下的键盘输入处理工具包,它包含了一些常用的工具和驱动程序,如loadkeys、dumpkeys、kbd_mode等。这些工具可以帮助用户配置和管理Linux系统下的键盘输入设备,包括设置键盘映射、键盘布局、键盘模式等。同时,kbd-misc-2.5.1还提供了一些驱动程序,如atkbd、ps2mouse等,用于支持各种类型的键盘和鼠标设备。kbd-misc-2.5.1是一个开源项目,它的源代码可以在GitHub上免费获取和更新,支持多种Linux发行版和硬件平台。 ### 回答2: kbd-misc-2.5.1 是一个开源软件包,其中包含了一些与键盘和输入设备有关的工具和驱动程序。这个软件包是在Linux内核中使用的,并提供了一些用于处理和管理键盘和输入设备的功能。 kbd-misc-2.5.1 软件包中的一些主要功能包括: 1. 键盘驱动程序:这个软件包提供了一些用于驱动各种类型的键盘的驱动程序。这些驱动程序允许操作系统与键盘进行通信,接收来自键盘的输入,并将其发送给应用程序。 2. 控制台工具:kbd-misc-2.5.1 还包含了一些用于控制台显示的工具。这些工具可以配置控制台的字体、颜色和布局等属性,提供了一些命令行工具来管理控制台的显示内容。 3. 输入法支持:该软件包还提供了对输入法的支持。它包含了一些输入法引擎和库文件,可以将输入法的功能集成到系统中,并提供输入法切换和输入法配置等功能。 4. 键盘映射:kbd-misc-2.5.1 还提供了一些工具和配置文件,用于定义键盘的映射规则。这允许用户自定义键盘的按键功能,以满足个人偏好或特定需求。 总之,kbd-misc-2.5.1 是一个用于处理和管理键盘和输入设备的开源软件包。它提供了一些驱动程序、工具和配置文件,允许用户自定义键盘和控制台的设置,并提供输入法支持和键盘映射功能。 ### 回答3: kbd-misc-2.5.1 是一个用于 Linux 操作系统的桌面键盘和控制台控制工具集。 kbd-misc-2.5.1 提供了一系列实用程序和工具,用于访问和管理 Linux 系统中的键盘和控制台。其中包括一些用于控制键盘布局和映射的工具,以及一些用于处理键盘输入的实用程序。这些工具可以帮助用户在 Linux 系统中调整和定制键盘的功能和行为。 kbd-misc-2.5.1 还包含一些用于控制台中显示的字符和图形的程序。这些程序可以提供更丰富的字符和图形显示效果,使控制台界面更加美观和易于使用。 该工具集还提供了一些用于处理输入事件和生成键盘事件的库和驱动程序。这些库和驱动程序可以与操作系统内核进行交互,以实现键盘输入的捕获和处理。 总的来说,kbd-misc-2.5.1 是一个功能丰富的工具集,用于在 Linux 系统中控制和定制键盘和控制台的功能和行为。它提供了一些实用程序、工具、库和驱动程序,帮助用户充分利用键盘和控制台的功能,提高系统的易用性和个性化定制能力。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值