I have an encryption algorithm, but I am unsure how to reverse the modulus that was performed. How do i do this? [closed]

橙三吉。 提交于 2020-03-17 03:23:55

问题


I have this encryption code, but I am unsure how to invert the modulus used in the code:

from PIL import Image

flag = Image.open(r"flag.png")
img = array(flag)

key = [41, 37, 23]

a, b, c = img.shape

for x in range (0, a):
    for y in range (0, b):
        pixel = img[x, y]
        for i in range(0,3):
            pixel[i] = pixel[i] * key[i] % 251
        img[x][y] = pixel

enc = Image.fromarray(img)
enc.save('enc.png')

来源:https://stackoverflow.com/questions/60696879/i-have-an-encryption-algorithm-but-i-am-unsure-how-to-reverse-the-modulus-that

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!