Einzelnen Beitrag anzeigen

shmia

Registriert seit: 2. Mär 2004
5.508 Beiträge
 
Delphi 5 Professional
 
#15

Re: OTP-Gen (One Time Pad Key Generator)

  Alt 6. Jul 2004, 15:10
Zitat von sakura:
Gravierender Nachteil bleibt der Fakt, daß die Maus nur recht wenig bewegt wird und somit nur wenige Daten anfallen
Man könnte die Daten mit den untersten 8 Bits des CPU Taktzyklenzählers anreichern.
Dies funktioniert allerdings nur beim Pentium Prozessor.
Delphi-Quellcode:
{**************************************************************************
* NAME:    GetCPUTick
* DESC:
* Processors Intel Pentium have a powerful command RDTSC.
* This is an extraction from Intel documentation on this command:
* "Loads the current value of the processor's time-stamp counter into the
* EDX:EAX registers.
* The time-stamp counter is contained in a 64-bit MSR.
* The high-order 32 bits of the MSR are loaded into the EDX register,
* and the low-order 32 bits are loaded into the EAX register.
* The processor increments the time-stamp counter MSR every clock cycle and
* resets it to 0 whenever the processor is reset."
* Note that RDTSC command returns the values in Int64 format used in Delphi.
*************************************************************************}

function GetCPUTick: Int64;
asm
   DB $0F,$31 // this is RDTSC command.
              // it is not supported by the Delphi inline assembler
end;
Andreas
  Mit Zitat antworten Zitat