This paper analyzes the performance of the MD5 and SHA algorithms in cryptography, focusing on their hash generation time and data integrity capabilities. MD5 operates with a 128-bit message digest, while SHA provides a 160-bit output, making SHA generally more secure than MD5. The study includes a detailed comparison of both algorithms' processes, parameters, and execution results, highlighting their similarities and differences.