the present invention in other instances well known electrical structures and circuits are shown in block diagram form in order not to obscure the present invention for example specific details are not provided as to whether the embodiments of the invention described herein are implemented as a software routine hardware circuit firmware or a combination thereof a design feature of a mac algorithm is that if the key is not known it is computationally infeasible to generate the corresponding mac value the present invention provides a method for increasing the security of any mac algorithm by adding the step of a further transformation of the mac value itself as generated by the mac algorithm in accordance with the present invention 1 first the mac value is generated by a secure hash which mac value is kept secret and 2 in addition a further transformation as described below is applied to the mac value the below described method can also be applied to hash functions and the use of a key in the second function introduces an added layer of security not previously present thus the application of the security enhancing method of the present invention enhances a hash function to have the security of a mac function to protect a mac value from attack another layer of security is applied by performing a further operation on the mac value.