Skip to content

Cypher-Project/Rivest-Cipher-4

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rivest-Cipher-4

Simple Rivest Cipher 4 In C

More informations : https://en.wikipedia.org/wiki/RC4

#include "rc4.h"
#include <stdio.h>

int main(void)
{
	unsigned char message[] = "Plaintext";
	unsigned char key[] = "Key";
	unsigned char output_buffer[0x100] = {0};
	unsigned char uncipher_buffer[0x100] = {0};

 	if (RC4_cipher(message, key, output_buffer, 0xFF, 3))
	 	fprintf(stderr,"[-] Error RC4 cipher function call !\n");
		
	// Print Cipher bytes
	printf("[+] Cipher Text : ");
	print_hex(output_buffer);
	printf("\t(%s)\n", message);

	// Uncipher output_buffer with the same key
	RC4_cipher(output_buffer, key, uncipher_buffer, 0xFF, 3);

	printf("[+] Uncipher Text : ");
	// Print UnCipher bytes
	print_hex(uncipher_buffer);
	
	printf("\t(%s)\n", uncipher_buffer);

	return (0);
}

About

Simple Rivest Cipher 4 In C

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 83.5%
  • Makefile 16.5%