Code base obscuration (for images) 1.0
It implements different obscuration methods on portable images (.pgm and .ppm)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Paillier_stats_on_r 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 pixel values 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)
 According to initial pixel value.
 
 avg_curve_mod_2_by_pixel_value (t_pix_enc, vector_r_values, n, size_vec_r, title, inverse)
 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, inverse)
 This function calculates and plots the average curve of encrypted pixel values modulo 4 by initial 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)
 According to initial pixel value, with different modulo, with common values where there is no r value for modulo k = 0.
 
 avg_curve_mod_k_by_pixel_value_and_lessthan_m (t_pix_enc, vector_r_values, n, size_vec_r, p, q, m, inverse)
 This function calculates and plots the average curve of encrypted pixel values modulo k by initial pixel value and less than 2^m.
 
 main ()
 The main function that calls other functions to calculate and plot average curves of encrypted pixel values.
 

Variables

 f_pix = open("results_pix_p3q83nbR164.txt", "r")
 Initialisation, get data.
 
int p = 3
 
int q = 83
 
 lines_pix = f_pix.readlines()
 
list t_pix_avg = []
 
list count_pix = []
 
 n = int(lines_pix[0])
 
 size_vec_r = int(lines_pix[1])
 
list vector_r_values = []
 
list t_pix_enc = []
 
int line_index = 2
 
 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_r.avg_curve_mod_2_by_pixel_value ( t_pix_enc,
vector_r_values,
n,
size_vec_r,
title,
inverse )

According to initial pixel value with differents modulo.

This function calculates and plots the average curve of encrypted pixel values modulo 2 by initial 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.
inverseA boolean value indicating whether to use inverse encryption or not.
Author
Katia Auxilien
Date
April 2024

◆ avg_curve_mod_4_by_pixel_value()

Paillier_stats_on_r.avg_curve_mod_4_by_pixel_value ( t_pix_enc,
vector_r_values,
n,
size_vec_r,
title,
inverse )

This function calculates and plots the average curve of encrypted pixel values modulo 4 by initial 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.
inverseA boolean value indicating whether to use inverse encryption or not.
Author
Katia Auxilien
Date
April 2024

◆ avg_curve_mod_k_by_pixel_value()

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

According to initial pixel value.

This function calculates and plots the average curve of encrypted pixel values modulo k by initial 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.
Author
Katia Auxilien
Date
April 2024

◆ avg_curve_mod_k_by_pixel_value_and_lessthan_m()

Paillier_stats_on_r.avg_curve_mod_k_by_pixel_value_and_lessthan_m ( t_pix_enc,
vector_r_values,
n,
size_vec_r,
p,
q,
m,
inverse )

This function calculates and plots the average curve of encrypted pixel values modulo k by initial pixel value and less than 2^m.

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.
mThe exponent value of 2 for the threshold.
inverseA boolean value indicating whether to use inverse encryption or not.
Author
Katia Auxilien
Date
April 2024

◆ avg_curve_mod_k_by_pixel_value_in_common()

Paillier_stats_on_r.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 )

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 pixel values modulo k by initial pixel value for common values where there is no r value for modulo k = 0.

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.
Author
Katia Auxilien
Date
April 2024

◆ avg_curve_mod_k_by_r_value()

Paillier_stats_on_r.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 pixel values 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_r.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 pixel values 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_r.main ( )

The main function that calls other functions to calculate and plot average curves of encrypted pixel values.

Author
Katia Auxilien
Date
April 2024

Variable Documentation

◆ count_pix

list Paillier_stats_on_r.count_pix = []

◆ f_pix

Paillier_stats_on_r.f_pix = open("results_pix_p3q83nbR164.txt", "r")

Initialisation, get data.

◆ line_index

int Paillier_stats_on_r.line_index = 2

◆ lines_pix

Paillier_stats_on_r.lines_pix = f_pix.readlines()

◆ n

Paillier_stats_on_r.n = int(lines_pix[0])

◆ p

int Paillier_stats_on_r.p = 3

◆ pix_value

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

◆ q

int Paillier_stats_on_r.q = 83

◆ r_value

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

◆ size_vec_r

Paillier_stats_on_r.size_vec_r = int(lines_pix[1])

◆ t_pix_avg

list Paillier_stats_on_r.t_pix_avg = []

◆ t_pix_enc

list Paillier_stats_on_r.t_pix_enc = []

◆ t_pix_enc_inv

list Paillier_stats_on_r.t_pix_enc_inv = []

Curves.

◆ t_pix_enc_inv_row

list Paillier_stats_on_r.t_pix_enc_inv_row = []

◆ t_pix_enc_row

list Paillier_stats_on_r.t_pix_enc_row = []

◆ vector_r_values

list Paillier_stats_on_r.vector_r_values = []

◆ x

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