Skip to content

MedTechChain/encryption

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Paillier Encryption Backend

Examples

Key generation

  • Input cargo run -- keygen --bit-length 2048

  • Output

    {"decryptionKey":"{\"p\":\"104157024370903378755509855656437819215132193099789544810116588859479487910087\",\"q\":\"79121506375029976285713814969018337087804456972774065068201367317397761395179\"}","encryptionKey":"{\"n\":\"8241060667766584287434755599209571407884345301204300583462570296404325647910247540830160249763583391055925150059624006601065459056303045917427668027270573\"}"}

Encryption

  • Input cargo run -- encrypt --plaintext 42 --ek "{\"n\":\"8241060667766584287434755599209571407884345301204300583462570296404325647910247540830160249763583391055925150059624006601065459056303045917427668027270573\"}"

  • Output 8999679018359495774699405762480399405865247726893115421287081914067827007931296890805396946005286228205858258328495239821463239498421748036796621523493630787366818830041128855028290332860333693087867165201220493989075499631271112332795918434995147494888548752178839256356433235601381445564033155924291493623

Decryption

  • Input cargo run -- decrypt --ciphertext "8999679018359495774699405762480399405865247726893115421287081914067827007931296890805396946005286228205858258328495239821463239498421748036796621523493630787366818830041128855028290332860333693087867165201220493989075499631271112332795918434995147494888548752178839256356433235601381445564033155924291493623" --dk "{\"p\":\"104157024370903378755509855656437819215132193099789544810116588859479487910087\",\"q\":\"79121506375029976285713814969018337087804456972774065068201367317397761395179\"}"
  • Output 42

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •