The main contribution of the paper is two-fold: Building step by step a chaotic hash function starting from a weak but basic algorithm and analyzing its strengths and weaknesses in order to make it stronger. We start with a basic chaotic hash function with a 128-bit message digest based on Baptista’s encryption algorithm. In the next steps, a pseudo-random number generator using chaotic tent map is incorporated within the hash algorithm and perturbation and block chaining approaches are used to strengthen the hash function. In the literature on chaotic cryptography we have not seen preimage and second-preimage resistance analyis being done which we carry out and show that the proposed hash function is strong against both these attacks. Further, the standard collision analysis is performed in the space of 1-bit neighbourhood of a given message. The hash function is shown to exhibit diffusion effect with average hamming distance between message digests obtained as 63 bits which is close to the ideal of 50%. The collision performance compares favourably with that of chaotic hash functions proposed in the recent literature. It is to be emphasized that the existing chaotic hash functions in the literature use a multitude of chaotic maps whereas we show in this paper that using two chaotic maps judiciously achieves a secure hash function.