This research proposes an algorithm to sign messages using the ElGamal asymmetric cryptosystem, called: Digital signature algorithm based on ElGamal, Diffie-Hellman protocol and the number π (DSAπ). This proposal has a high level of security like the DSA standard, in addition, execution times are reduced in relation to it. The Diffie-Hellman protocol and the number π were used in the construction of the digital signature algorithm in conjunction with the Hash-Sha-512 function. Some experiments are presented to provide evidence that the bits on the right side of the decimal point of π appear randomly, such as: a color image was constructed of a string of consecutive bits chosen at random, of the number π. Subsequently, parameters such as: entropy, correlation, discrete Fourier transform, goodness-of-fit test χ2 were evaluated. It is mentioned that an S-box 8×8 is involved in the signature. The sensitivity of the signature was measured, that is, when small changes are made to the sender’s private key, or small changes to the message. Finally, an image was constructed using the signatures of random texts, and subsequently the randomness of its pixels was obtained, to verify that there is no relationship between the different signatures.