align="justify">// Значення біта в подвійному слові (32біт)
function Bit (Value, n: Integer): Boolean; eax, edxaleax, 0FFh; p_number (X: LongInt): boolean; i: LongInt; x> 1 then: = false; i: = 2 to trunc (sqrt (x)) dox mod i = 0 then Exit;: = true;: = false;; HOD (a, b: int64): int64; r: int64; ((a = 0) or (b = 0)) then: = abs (a + b);;;: = ab * (a div b); r <> 0 do begin: = b;: = r;: = ab * (a div b) ;;: = b;; FastPower (a, b, n: integer): integer; i: integer;: extended;: = a; I: = Trunc (log2 (b)) - 1 downto 0 doBit (b, i ) then ai: = Round (sqr (ai) * a) mod n else ai: = Round (sqr (ai)) mod n;: = Round (ai);; Encrypt (s: string; e, n: integer) : TIncodeMes; I: Integer; (result, length (s)); I: = 0 to Length (s) - 1 dos [i +1] <> '0 'then [i]: = FastPower (ord ( s [i + 1]), e, n);; Decrypt (s: array of integer; e, n: integer): string; i: Integer; (Result, Length (s)); I: = 0 to Length (s) - 1 dos [i +1] <> 0 then [i + 1]: = chr (FastPower (s [i], e, n)); TMain.Button3Click (Sender: TObject);, p , q, tmp, i, e: longword;;: = Random (100);: = Random (100); not p_number (p) do dec (p); not p_number (q) do dec (q);. Text : = IntToStr (p);. text: = IntToStr (q);: = p * q;: = (p-1) * (q-1); i: = 2 to tmp-1 doHOD (tmp, i) = 1 then break; e: = i;. Text: = IntToStr (i); i: = 1 to n do (i * e) mod ((p-1) * (q-1)) = 1 then;. Text: = IntToStr (i);. Clear;: = Encrypt (Memo1.Lines.Text, e, n); i: = 0 to High (FMes) do.Lines.Append (IntToStr (FMes [i])); end;