It is computationally impossible for one-way hash functions to obtain the original data again. In this study, Two Way Hash Function (TWHF) is proposed which provides the security properties of one-way hash functions. TWHF aims to hash/encrypt and decrypt input data of arbitrary length. This allows data to be encrypted or decrypted regardless of its size. The proposed method uses "iteration-key" and secondary key to ensure confidentiality. In the study, strong hints were obtained that TWHF fulfils the security properties of one-way hash functions. TWHF stores the original data as small bit sets in a generated decimal number pattern. The last decimal number of the generated decimal number pattern is the hash code and the encrypted data. The contribution of the work is to propose an original data change function, data/block classification and workflow, and a functional method that has not yet been studied in the literature. The results show that the hashing/encryption process works consistently and that on average 99.83% of the data is decrypted smoothly in the decryption process.INDEX TERMS Cryptography, cryptology, hash functions, one way hash functions, two way hash functions.