In the method a graphical password is produced for an electronic system,
such as a database, a computer program or Internet pages, the password
being composed of various identifier images that are clearly
distinguishable from each other. The system can be located in a terminal
device used by the user, such as a mobile phone or an object separate
from the terminal device, to which the user can be connected via the
terminal device. For producing the password, the electronic system
includes an image archive, in which various partial images representing
certain subareas of a whole identifier image have been saved in
electronic form. The partial images are divided into subgroups so that
the partial images of the same subgroup always represent the same subarea
of the identifier image. The identifier images belonging to the graphical
password are composed by selecting partial images from different
subgroups and by combining the selected partial images into one complete
identifier image.