A New Chaotic Encryption Algorithm Based on Ergodicity