keygen: Generate cryptographic keys

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/keygen.R

Description

This function will generate cryptographic keys to enable encryption, decryption and possibly other operations (such as relinearisation or bootstrapping) for the homomorphic encryption schemes supported in this package.

Usage

1
keygen(p)

Arguments

p

a parameters object as produced by the pars function.

Details

The scheme to be used is determined by the type of the parameters object, p.

Value

A list object containing the keys will be returned

Depending on the scheme specified by the parameters object the exact structure will vary. For example, a symmetric key scheme will only return a private key, whereas a public key scheme will return a public and private keypair. Certain schemes may include additional keys for operations such as relinearisation or bootstrapping. The keys will be named pk (public), sk (private), rlk (relinearisation), bk (bootstrapping) in the list object if they are part of the scheme.

Author(s)

Louis Aslett

See Also

pars for generating the parameters for a scheme; enc for encrypting messages using the keys generated by this function.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
p <- pars("FandV")
keys <- keygen(p)

# Look at public key and encrypt
keys$pk
ct <- enc(keys$pk, 1)

# Look at private key and decrypt
keys$sk
dec(keys$sk, ct)

# Obviously a different private key won't be able to decrypt
keys2 <- keygen(p)
keys2$sk
dec(keys2$sk, ct)

iamtrask/R-Homomorphic-Encryption-Package documentation built on May 29, 2019, 2:56 p.m.