Skip to content

Seungho324/PP-Vul

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PP-Vul: Privacy-Preserving Vulnerability Detection Using Homomorphic Encryption

This repository contains the implementation of PP-Vul.

Requirements

We have confirmed that PP-Vul can be executed on a 64-bit Ubuntu 18.04 system with python

How to use PP-Vul

1. Dataset pre-processing

1.1. Normalization

mv Dataset-sard rawdata
  • Normalize the dataset
python normalization.py -i ../dataset/rawdata

1.2. Embedding

  • Move to preprocessing folder.
python codet5embedding.py -i ../dataset/normalized/Vul -o ../dataset/embedding/1_line/Vul -n 1
python codet5embedding.py -i ../dataset/normalized/No-Vul -o ../dataset/embedding/1_line/No-Vul -n 1

1.3. Split dataset (train:valid:test=7:2:1)

python split_data.py -i ../dataset/embedding -o ../dataset/1_line 

2. PP-Vul

2.1. Model training (HE-friendly)

  • Default model: Kernel height = 4, Number of filters = 16, Activation function = $x^3$, Depthwise convolution
  • Move to pp-vul folder.
python classifier.py -i ../dataset/1_line 

2.2. Privacy-preserving inference using homomorphic encrytion

python main.py -i ../dataset/1_line 

3. Plaintext model

  • Default model: Number of kernel = 10, Number of filters = 32, Activation function = ReLU, Max pooling
  • Move to plaintext_model folder.
python classifier.py -i ../dataset/1_line

About

Privacy-Preserving Vulnerability Detection

Resources

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •  

Languages