1. A hash value generating method which is used for digital signature or data encryption comprising: a first step for dividing target data into at least two blocks; a second step for performing character-substitution and/or transposition processing on any one of the at least two blocks obtained in said first step; a third step for performing multiplication on the data obtained in said second step so that the data length of the multiplication result is longer than the data length of the data concerned; a fourth step for further dividing the data obtained in said third step into at least two blocks; and a fifth step for performing character-substitution and/or transposition processing on each of the at least two blocks obtained in said fourth step.