Jump to content
Zero_Negative

Program Criptare Caesar

Recommended Posts

Posted

Postez si eu un programel simplu de Criptare Caesar. Documentatie despre criptare Cifrul Cezar - Wikipedia

Programul face toate combinatiile posibile (brute force), insa ramane ca utilizatorul sa isi dea seama care este combinatia buna.

Postez acest program in scopuri pur educative. Learn from it, improve it! Daca aveti intrebari despre program va raspund cu ce-a mai mare placere.

Programul:

Ceasar Brutus.exe

Codul Sursa:

Source.txt

P.S. This is my first post on RST.

Posted (edited)

Dupa modul in care ai scris codul, as zice ca esti la Calculatoare, Anul I - UPIT. Right?

Din ce am gasit prin proiectele vechi:


char* criptare_caesar(char* text, int nr_rot) {
unsigned int i, n = sizeof(text);
int rot = 26 - nr_rot; // adaptat ca sa mearga cu "brute force-ul" tau.
for(i=0; i < n; i++)
text[i] = isalpha(text[i]) ? ('A' + ((toupper(text[i]) - 'A') + rot) % 26) : ' ';
return text;
}

char* decriptare_caesar(char* text, int nr_rot) {
unsigned int i, n = sizeof(text);
int rot = 26 - nr_rot; // adaptat ca sa mearga cu "brute force-ul" tau.
for(i=0; i < n; i++)
text[i] = isalpha(text[i]) ? tolower('A' + ((toupper(text[i]) - 'A') - rot) % 26) : ' ';
return text;
}

Restul e cancan.

Dar cred ca nu l-ai incadrat bine la "programe hack" ;)

Edited by A9N
Posted
Postez si eu un programel simplu de Criptare Caesar. Documentatie despre criptare Cifrul Cezar - Wikipedia

Programul face toate combinatiile posibile (brute force), insa ramane ca utilizatorul sa isi dea seama care este combinatia buna.

Postez acest program in scopuri pur educative. Learn from it, improve it! Daca aveti intrebari despre program va raspund cu ce-a mai mare placere.

Programul:

Ceasar Brutus.exe

Codul Sursa:

Source.txt

P.S. This is my first post on RST.

Criptare e mult spus, e substitutie

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...