The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
Set some parameters.
Set a working seed for random numbers
Create the secret key and the polynomials a and e, which will go into the public key
# generate a secret key
s = GenSecretKey(n)
# generate a
a = GenA(n, q)
# generate the error
e = GenError(n)
Generate the public key.
Create a polynomial message
Create polynomials for the encryption
Generate the ciphertext
ct0 = pk0*u + p*e1 + m
ct0 = ct0 %% pm
ct0 = CoefMod(ct0, q)
ct1 = pk1*u + p*e2
ct1 = ct1 %% pm
ct1 = CoefMod(ct1, q)
Decrypt
decrypt = (ct1 * s) + ct0
decrypt = decrypt %% pm
decrypt = CoefMod(decrypt, q)
decrypt = CoefMod(round(decrypt), p)
print(decrypt)
#> 1 + x + x^2
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.