A method and apparatus are provided for improving the security of data transmissions between stations and for controlling secured transactions from remote locations in a data-transfer system. The method and apparatus obviate the need for transmitting user-identification information such as personal identification number (PIN) from station to station, e.g., from the station utilized by the user to enter his PIN and initiate a transaction, to the station that processes the transaction. Also, for added security, the method and apparatus provide for encryption (encoding) and decryption (decoding) of data during a transaction using encryption and decryption keys produced from different (independent) PINs. The apparatus includes at least one irreversible algorithm module, a random number generator and at least one data file (e.g., disc or magnetic tape storage). The apparatus also includes a comparator or, alternatively, an encoding algorithm module and a matching decoding algorithm module. In addition, a data-transfer system obviates the need for paired encryption/decryption modules on a data link while nevertheless maintaining a high level of security in the data transferred. This facilitates remote control of data transfers between locations within the system, enables use of conventional data links, and permits convenient changes of and additions to the files of stored codes for the system without compromising the security of data transfers or of identifying codes for authorized individuals.