The days of long lines at banks and piles of paperwork are long gone. The lending landscape has been completely transformed by digital loans, which provide a quick, easy, and frequently paperless transactions. A payee can apply for a digital loan anytime, anywhere. The entire lending procedure is accessible and efficient, but the availability of data on the Internet provides many risks and threats, where there are certain difficulties in the world of digital lending and data security, and privacy are major concerns. It is important to address the possibility of predatory lending practices that target weaker payees, especially with flash loans, which are considered a critical type of digital loan, as they add additional pressure to banks in terms of security because they return to the same block of the blockchain, and the possibility of tampering with them is considered great. Therefore, we have developed a security protocol based on the principle of digital cryptocurrency wallets: these digital wallets are protected by our use of the Xsalsa20 algorithm. It has high specifications and is enhanced with the usage of the Crow search algorithm, which guarantees fast and efficient search results. After the analysis of the proposed system in the Tamarin Prover tool, we obtained proof of a lot of security properties like data authenticity, perfect forward secrecy, and many others, which constitute the matter that gives our system the power of security. Also, we obtained 0.6667 ms. as the rate of processing speed, 2990 ms. as the time required by the proposed system to repay loans after the conditions are met, and, finally, our proposed system has the power to present a flexible property by creating 29,700 loans every 3 s; by this, we obtained a system that is secure, authentic, fast, and flexible.