Symmetric key algorithms are a typically efficient and fast cryptosystem, so it has significant applications in many realms. For a wireless ad hoc network with constraint computational resources, the cryptosystem based on symmetric key algorithms is extremely suitable for such an agile and dynamic environment, along with other security strategies. In this paper, we introduce the concept of selective encryption into the design of data protection mechanisms. First, we present the principle of selective encryption and propose a probabilistically selective encryption algorithm based on symmetric key. By utilizing probabilistic methodology and stochastic algorithm, a sender includes proper uncertainty in the process of message encryption, so that only entrusted receiver can decrypt the ciphertext and other unauthorized nodes have no knowledge of the transmitted messages on the whole. In addition, we also employ other security mechanisms to enhance the security of our proposed scheme. Eventually, we carry out an extensive set of simulation experiments based on ns2 simulator, and our simulation indicates that the technique of selective algorithms can indeed improve the efficiency of message encryption.