//https://forum.pcsoft.fr/fr-FR/pcsoft.br.windev/2251-about-cryptstandart-and-uncryptstandart-2254/read.awp
Encripta(St is string, Pw is string) x is string i is int n is int p is int j is int //n0 is int ok is boolean
p = 0
FOR i = 1 TO Length(St) p += 1 IF p > Length(Pw) THEN p = 1 j = Asc(Middle(Pw, p, 1)) OR 128 n = Asc(Middle(St, i))
ok = False
WHILE ok = False n = BinaryXOR(n, j) //encripta... IF n < 31 THEN //se char de controle n = (128 + n) //somar 128 e //GoTo DeNovo //ecripta novamente ELSE IF n > 127 AND n < 159 THEN //se nesta faixa pode ser char de controle n = n - 128 //tira 128 e //GoTo DeNovo //encripta novamente ELSE ok = True END END x = x + Charact(n) //concatena string encriptada
END
RESULT x |