Some kind of encryption in C++
using namespace std; is a bad habit. It's not that tedious to write std:: a few times and you get less name collisions on things you define.



Your indentation is inconsistent. This makes it difficult to follow the control flow. 



The even parity can be discovered with repeated xors:

int has_even_parity(int c) {
   c ^= c &gt;&gt; 4;
   c ^= c &gt;&gt; 2;
   c ^= c &gt;&gt; 1;
   return ! (c&amp;1);
}




short int l_ = 0b0000000;
c_ = l_ | c_;


This doesn't do anything. 



I suggest adding some underscores in the binary literals to group the digits:

unsigned short int mask = 0b0111_1111_1000_0000;


This makes it easier to tell at a glance that there are 7 zeros at the end and that you meant for them to be there. Though once you are more comfortable with hexadecimal then 0x7f80 is just as clear.