This paper briefly introduces wireless sensor networks (WSNs) and proposes an enhancement to a block encryption algorithm using chaotic mapping principles. The proposed encryption algorithm was tested on an established WSN platform in a simulation experiment, and a comparative analysis was conducted with two encryption algorithms, advanced encryption standard (AES) and data encryption standard (DES). The results indicated that, as the volume of encrypted data grew, the encryption time for all three algorithms exhibited an upward trend, the 0-1 balance degree of the ciphertext decreased, and the information entropy increased. Specifically, for a given size of encrypted data, the optimized encryption algorithm demonstrated the shortest encryption time, the smallest 0-1 balance degree in the ciphertext, and the highest information entropy, closely approaching the ideal value. © 2024, Politechnica University of Bucharest. All rights reserved.