# Rabin Cryptosystem Technique Implementation in C

The Rabin cryptosystem is an asymmetric cryptographic technique, whose security, like that of RSA, is related to the difficulty of factorization. However the Rabin cryptosystem has the advantage that the problem on which it relies has been proved to be as hard as integer factorization, which is not currently known to be true of the RSA problem.

Rabin cryptosystem has the disadvantage that each output of the Rabin function can be generated by any of four possible inputs; if each output is a ciphertext, extra complexity is required on decryption to identify which of the four possible inputs was the true plaintext.

This article do not cover algorithm behind the Rabin cryptosystem. We suggest to go through very simple explanation given on Wikipedia for detailed explanation on Key generation, Encryption and Decryption.

Following is the implementation of the Rabin cryptosystem in C.

Output:

p = 383, q = 59, n = 22597

PlainText is 12419
Cipher Text is 7036

P1 = 10944
P2 = 10178
P3 = 12419
P4 = 11653

(1 votes, average: 5.00 out of 5)