Tham khảo tài liệu 'hacker professional ebook part 184', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Knuth 41 for an introduction. Note that one does not need random numbers to determine the public and private exponents in RSA after choosing the modulus. One can simply choose an arbitrary value for the public exponent which then determines the private exponent or vice versa. What if users of RSA run out of distinct primes There are enough prime numbers that RSA users will never run out of them. For example the number of primes of length 512 bits or less exceeds 10A 150 according to the prime number theorem this is more than the number of atoms in the known universe. How do you know if a number is prime It is generally recommended to use probabilistic primality testing which is much quicker than actually proving a number prime. One can use a probabilistic test that decides if a number is prime with probability of error less than 2A -100 . For further discussion of some primality testing algorithms see the papers in the bibliography of 5 . For some empirical results on the reliability of simple primality tests see Rivest 70 one can perform very fast primality tests and be extremely confident in the results. A simple algorithm for choosing probable primes was recently analyzed by Brandt and Damgard 9 . How is RSA used for encryption in practice RSA is combined with a secret-key cryptosystem such as DES to encrypt a message by means of an RSA digital envelope. Suppose Alice wishes to send an encrypted message to Bob. She first encrypts the message with DES using a randomly chosen DES key. Then she looks up Bob s public key and uses it to encrypt the DES key. The DES-encrypted message and the RSA-encrypted DES key together form the RSA digital envelope and are sent to Bob. Upon receiving the digital envelope Bob decrypts the DES key with his private key then uses the DES key to decrypt to message itself. How is RSA used for authentication in practice Suppose Alice wishes to send a signed message to Bob. She uses a hash function on the message see .