Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sage.all import * | |
import sys | |
q,n,a,s = (3,59,10,25) | |
m = n+1-a+s | |
FF = GF(q) | |
R = PolynomialRing(FF, ["x{}".format(i) for i in range(n)]) | |
xs = R.gens() | |
pk, ct = open("output").readlines() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from Crypto.PublicKey import RSA | |
from Crypto.Util.number import getPrime, bytes_to_long as b2l | |
from itertools import cycle | |
from random import randint | |
class reveal: | |
def __init__(self, info, bitlen): | |
self.coeff = cycle(info) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import urandom | |
from Crypto.Util.number import long_to_bytes as l2b | |
from Crypto.Util.number import bytes_to_long as b2l | |
from Crypto.Cipher import AES | |
from data import * | |
load("chall.sage") | |
keys = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
""" | |
The decryption looks like this: | |
(f * ctpol) % q * inverse(f, mod 3) % 3 | |
Note that; | |
- (f) is a "small" polynomial (61 values 1 and -1, others are zero). | |
- (% q) is done to [-63; 64] | |
If (f*ctpol) does not wrap over q |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.