The invention is related to a key exchange algorithm to develop a public key cryptosystem and digital signature scheme. The algorithm is significantly faster and more practical to be used in online transactions, larger key sizes can be used with a very short execution time which provides high-security levels. Thus, the generated digital signature acts as a hash value as it’s changed for every single change that happens in the document.