Code base obscuration (for images) 1.0
It implements different obscuration methods on portable images (.pgm and .ppm)
Loading...
Searching...
No Matches
Paillier_stats_on_g Namespace Reference

Functions

 avg_curve_mod_k_by_r_value (t_pix_enc, vector_r_values, n, size_vec_r, p, q)
 According to r value.
 
 avg_curve_mod_k_by_r_value_inv (t_pix_enc, vector_r_values, n, size_vec_r, p, q)
 This function calculates and plots the average curve of encrypted pixels modulo k by r value for inverse encryption.
 
 avg_curve_mod_k_by_pixel_value (t_pix_enc, vector_r_values, n, size_vec_r, p, q, inverse, g)
 According to initial pixel value.
 
 avg_curve_mod_2_by_pixel_value (t_pix_enc, vector_r_values, n, size_vec_r, title)
 According to initial pixel value with differents modulo.
 
 avg_curve_mod_4_by_pixel_value (t_pix_enc, vector_r_values, n, size_vec_r, title)
 This function calculates and plots the average curve of encrypted pixels modulo 4 by pixel value.
 
 avg_curve_mod_k_by_pixel_value_in_common (t_pix_enc, t_pix_inv_enc, vector_r_values, n, size_vec_r, p, q, g)
 According to initial pixel value, with different modulo, with common values where there is no r value for modulo k = 0.
 
 traiterResultats (f_pix, p, q)
 This function processes the results and plots various curves.
 
 main ()
 The main function that processes all result files in a directory.
 

Variables

 f_pix = open(f_pix, "r")
 Initialisation, get data.
 
int p = 13
 
int q = 19
 
 lines_pix = f_pix.readlines()
 
list t_pix_avg = []
 
list count_pix = []
 
 g = int(lines_pix[0])
 
 n = int(lines_pix[1])
 
 size_vec_r = int(lines_pix[2])
 
list vector_r_values = []
 
list t_pix_enc = []
 
int line_index = 3
 
 r_value = np.uint64(lines_pix[line_index].strip())
 
list t_pix_enc_row = []
 
 pix_value = np.uint16(lines_pix[line_index].strip())
 
list t_pix_enc_inv = []
 Curves.
 
list t_pix_enc_inv_row = []
 
 x = np.invert(np.array(t_pix_enc[i][j], dtype=np.uint16))
 

Function Documentation

◆ avg_curve_mod_2_by_pixel_value()

Paillier_stats_on_g.avg_curve_mod_2_by_pixel_value ( t_pix_enc,
vector_r_values,
n,
size_vec_r,
title )

According to initial pixel value with differents modulo.

This function calculates and plots the average curve of encrypted pixels modulo 2 by pixel value.

Parameters
t_pix_encA 2D list containing encrypted pixel values.
vector_r_valuesA list containing r values.
nThe number of pixels.
size_vec_rThe size of the r value vector.
titleThe title of the plot.
Author
Katia Auxilien
Date
April 2024

◆ avg_curve_mod_4_by_pixel_value()

Paillier_stats_on_g.avg_curve_mod_4_by_pixel_value ( t_pix_enc,
vector_r_values,
n,
size_vec_r,
title )

This function calculates and plots the average curve of encrypted pixels modulo 4 by pixel value.

Parameters
t_pix_encA 2D list containing encrypted pixel values.
vector_r_valuesA list containing r values.
nThe number of pixels.
size_vec_rThe size of the r value vector.
titleThe title of the plot.
Author
Katia Auxilien
Date
April 2024

◆ avg_curve_mod_k_by_pixel_value()

Paillier_stats_on_g.avg_curve_mod_k_by_pixel_value ( t_pix_enc,
vector_r_values,
n,
size_vec_r,
p,
q,
inverse,
g )

According to initial pixel value.

This function calculates and plots the average curve of encrypted pixels modulo k by pixel value.

Parameters
t_pix_encA 2D list containing encrypted pixel values.
vector_r_valuesA list containing r values.
nThe number of pixels.
size_vec_rThe size of the r value vector.
pA prime number used in Paillier encryption.
qAnother prime number used in Paillier encryption.
inverseA boolean value indicating whether to use inverse encryption or not.
gA value used in Paillier encryption.
Author
Katia Auxilien
Date
April 2024

◆ avg_curve_mod_k_by_pixel_value_in_common()

Paillier_stats_on_g.avg_curve_mod_k_by_pixel_value_in_common ( t_pix_enc,
t_pix_inv_enc,
vector_r_values,
n,
size_vec_r,
p,
q,
g )

According to initial pixel value, with different modulo, with common values where there is no r value for modulo k = 0.

This function calculates and plots the average curve of encrypted pixels modulo k by pixel value for common values.

Parameters
t_pix_encA 2D list containing encrypted pixel values.
t_pix_inv_encA 2D list containing inversely encrypted pixel values.
vector_r_valuesA list containing r values.
nThe number of pixels.
size_vec_rThe size of the r value vector.
pA prime number used in Paillier encryption.
qAnother prime number used in Paillier encryption.
gA value used in Paillier encryption.
Author
Katia Auxilien
Date
April 2024

◆ avg_curve_mod_k_by_r_value()

Paillier_stats_on_g.avg_curve_mod_k_by_r_value ( t_pix_enc,
vector_r_values,
n,
size_vec_r,
p,
q )

According to r value.

This function calculates and plots the average curve of encrypted pixels modulo k by r value.

Parameters
t_pix_encA 2D list containing encrypted pixel values.
vector_r_valuesA list containing r values.
nThe number of pixels.
size_vec_rThe size of the r value vector.
pA prime number used in Paillier encryption.
qAnother prime number used in Paillier encryption.
Author
Katia Auxilien
Date
April 2024

◆ avg_curve_mod_k_by_r_value_inv()

Paillier_stats_on_g.avg_curve_mod_k_by_r_value_inv ( t_pix_enc,
vector_r_values,
n,
size_vec_r,
p,
q )

This function calculates and plots the average curve of encrypted pixels modulo k by r value for inverse encryption.

Parameters
t_pix_encA 2D list containing encrypted pixel values.
vector_r_valuesA list containing r values.
nThe number of pixels.
size_vec_rThe size of the r value vector.
pA prime number used in Paillier encryption.
qAnother prime number used in Paillier encryption.
Author
Katia Auxilien
Date
April 2024

◆ main()

Paillier_stats_on_g.main ( )

The main function that processes all result files in a directory.

Author
Katia Auxilien
Date
April 2024

◆ traiterResultats()

Paillier_stats_on_g.traiterResultats ( f_pix,
p,
q )

This function processes the results and plots various curves.

Parameters
f_pixThe file containing pixel data.
pA prime number used in Paillier encryption.
qAnother prime number used in Paillier encryption.
Author
Katia Auxilien
Date
April 2024

Variable Documentation

◆ count_pix

list Paillier_stats_on_g.count_pix = []

◆ f_pix

Paillier_stats_on_g.f_pix = open(f_pix, "r")

Initialisation, get data.

◆ g

Paillier_stats_on_g.g = int(lines_pix[0])

◆ line_index

int Paillier_stats_on_g.line_index = 3

◆ lines_pix

Paillier_stats_on_g.lines_pix = f_pix.readlines()

◆ n

Paillier_stats_on_g.n = int(lines_pix[1])

◆ p

int Paillier_stats_on_g.p = 13

◆ pix_value

Paillier_stats_on_g.pix_value = np.uint16(lines_pix[line_index].strip())

◆ q

int Paillier_stats_on_g.q = 19

◆ r_value

Paillier_stats_on_g.r_value = np.uint64(lines_pix[line_index].strip())

◆ size_vec_r

Paillier_stats_on_g.size_vec_r = int(lines_pix[2])

◆ t_pix_avg

list Paillier_stats_on_g.t_pix_avg = []

◆ t_pix_enc

list Paillier_stats_on_g.t_pix_enc = []

◆ t_pix_enc_inv

list Paillier_stats_on_g.t_pix_enc_inv = []

Curves.

◆ t_pix_enc_inv_row

list Paillier_stats_on_g.t_pix_enc_inv_row = []

◆ t_pix_enc_row

list Paillier_stats_on_g.t_pix_enc_row = []

◆ vector_r_values

list Paillier_stats_on_g.vector_r_values = []

◆ x

Paillier_stats_on_g.x = np.invert(np.array(t_pix_enc[i][j], dtype=np.uint16))