Encryption
WeVPN uses AES-256-GCM as the default encryption.
AES-GCM is a more secure cipher than AES-CBC, because AES-CBC, operates by XOR'ing (eXclusive OR) each block with the previous block and cannot be written in parallel. This affects performance due to the complex mathematics involved requiring serial encryption. AES-CBC also is vulnerable to padding oracle attacks, which exploit the tendency of block ciphers to add arbitrary values onto the end of the last block in a sequence in order to meet the specified block size.
The Galois/Counter Mode (GCM) of operation (AES-256-GCM), however, operates differently. GCM combines Galois field multiplication with the counter mode of operation for block ciphers. The counter mode of operation is designed to turn block ciphers into stream ciphers, where each block is encrypted with a pseudorandom value from a “keystream”. The concept achieves this by using successive values of an incrementing “counter” such that every block is encrypted with a unique value that is unlikely to reoccur. The Galois field multiplication component enhances by conceptualizing each block as its own finite field for the use of encryption on the basis of the AES standard. Additionally, AES-GCM incorporates the handshake authentication into the cipher natively and, as such, it does not require to handshake.
AES-GCM is written in parallel which means throughput is significantly higher than AES-CBC by lowering encryption overheads. Each block with AES-GCM can be encrypted independently. The AES-GCM mode of operation can actually be carried out in parallel both for encryption and decryption.