Bonjour à toutes et à tous,
Avec Outlook Windows 11 je reçois beaucoup d'emails avec une grande partie codée en Base 64.
Ils sont naturellement bloqué et je peus vérifier la source.
En D6 j'avais un code qui apparemment ne fonctionne pas avec ce cryptage :
Une partie du texte codé de l'email :
PSJ1cm46c2NoZW1hcy1taWNyb3NvZnQtY29tOnZtbCIgeG1sbnM6bz0idXJuOnNjaGVtYXMtbWlj
cm9zb2Z0LWNvbTpvZmZpY2U6b2ZmaWNlIj4NCiAgICA8aGVhZD4NCiAgICAgICAgPCEtLSBOQU1F
OiBBTk5PVU5DRSAtLT4NCiAgICAgICAgPCEtLVtpZiBndGUgbXNvIDE1XT4NCiAgICAgICAgPHht
bD4NCiAgICAgICAgICAgIDxvOk9mZmljZURvY3VtZW50U2V0dGluZ3M+DQogICAgICAgICAgICA8
Sur ce site pas de problème "https://www.base64decode.org/fr/"
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76 const Codes64 = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/'; function Encode64(S: string): string; var i: Integer; a: Integer; x: Integer; b: Integer; begin Result := ''; a := 0; b := 0; for i := 1 to Length(s) do begin x := Ord(s[i]); b := b * 256 + x; a := a + 8; while a >= 6 do begin a := a - 6; x := b div (1 shl a); b := b mod (1 shl a); Result := Result + Codes64[x + 1]; end; end; if a > 0 then begin x := b shl (6 - a); Result := Result + Codes64[x + 1]; end; end; function Decode64(S: string): string; var i: Integer; a: Integer; x: Integer; b: Integer; begin Result := ''; a := 0; b := 0; for i := 1 to Length(s) do begin x := Pos(s[i], codes64) - 1; if x >= 0 then begin b := b * 64 + x; a := a + 6; if a >= 8 then begin a := a - 8; x := b shr a; b := b mod (1 shl a); x := x mod 256; Result := Result + chr(x); end; end else Exit; end; end; procedure TForm1.BDecoderClick(Sender: TObject); begin Decode64(memo2.text); end; procedure TForm1.BEncoderClick(Sender: TObject); begin Encode64(memo1.text); end; end.
Si quelqu'un avait une autre solution plus performante en D6, merci d'avance.
@+,
cincap
Partager