Jump to content
sulea

decriptare2 [usor+]

Recommended Posts

se da un text,

codurile ascii ale literelor se memoreaza intr-un vector V;

se da o cheie de criptare (sa spunem un nr intre 1 si 255)

function cript

for i de la 1 la length_text

v=v*cheie

for j de la i la length_text

inc cheie

v[j]=v[j]+cheie+j

end for

end for

v[i+1]=(cheie+15+3*i+3*2-1*3)+v

end function

care a fost textul initial care s-a criptat si ce cheie s-a folosit, daca avem urmatorul output in vectorul v:

16010 40043 70308 106877 155434 191991 268502 335265 410798 491027 572045 658650 748718 846627 939031 1033322 1033662

trimiteti raspunsurile prin pm.

poate dau si cate un log user/parole castigatorilor.

primul care rezolva challengeul este em. felicitari

antrax200 si staticwater au rezolvat corect!!

Edited by sulea
Link to comment
Share on other sites

Sigur acolo vroiai sa pui

 v[i+1]=(cheie+15+3*i+3*2-1*3)+v[i] 

?

Ai iesit din for cu i=nr_el, deci degeaba e i, si oricum nu faci nimic, ca faci referire la i+1.Oricum, nu asta era ideea, vroiam doar sa-ti atrag atentia, sa te uiti peste linia aia si sa spui daca ala e sigur locul ei.

*Codul in C++, pentru cei care nu stiu Pascal (sau ce-o fi acolo)*


for(i=1; i<=lung; ++i){
v[i]*=cheie;
for(j=i; j<=lung; ++j){
++cheie;
c[j]=c[j]+cheie+j;
}
}
v[i+1]=(cheie+15+3*i+3*2-1*3)+v[i];

Edited by Patrunjel
Link to comment
Share on other sites

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...