The paper deals with the security problems of scan design and investigates currently proposed solutions. A solution based on data encryption to protect the data in scan chains is discussed and problems related to the block-based encoding are outlined. Next, security extension for IEEE Std. 1149.1 providing a locking mechanism is analysed. The mechanism prevents unauthorised users to interfere via test bus with the system normal operation. Possible attack scenario is considered and the probabilities of successful attack within a given time interval are calculated for different lengths of the Lock register. The paper concludes with the description of current work focused on improvements the security of the locking mechanism, in particular by using simplified public key infrastructure.