The invention discloses an AES parallel implementation method based on OpenCL. According to the scheme, when an AES performs
parallel running on an AMD GPU based on OpenCL, optimum performance can be achieved. The method includes the following steps that first, the number of
plaintext /
ciphertext and the number of round key groups are determined, and
plaintext /
ciphertext and round key data are prepared; second, an executing mode of the AES is determined, and preparation is made for writing of a KiReadyThread; third, the KiReadyThread is written; fourth, a master OpenCL program file is written, and preparation is made for execution of an OpenCL program; fifth, program running parameters are set, memory space is allocated, and the program runs; sixth, the
encryption and decryption result is acquired, and resources are released. According to the method, in
parallel running process of the AES, data are reasonably allocated in a memory and parallel
granularity is reasonably selected so that running performance can be improved, and the method can be used for fast
encryption and decryption or
password cracking machines.