Qt → Qt/C++ - Tutorial 069. XOR Encryption
XOR-encryption is the application of a key through bitwise exclusive OR to the source text. The mechanism of the bitwise exclusive is the following:
X | Y | X⊕Y |
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
Thus, when executing an exclusive OR, there will always be a zero value if the variables have the same values.
The peculiarity of XOR is that one and the same function can both encrypt data and decrypt it. This is a simple method of data encryption, which can be hacked quickly enough if there is a large enough encrypted text, or a large password dictionary. But nevertheless, this can already be used for small initial data protection.
In the context of Qt, the use of XOR is no different from how the program was written without using Qt. The question here is how to extract data for encryption from QString objects, for example, if the text was entered in QTextEdit.
To do this, write a program that contains:
- QTextEdit, In which the text will be entered, which will be encrypted.
- QLineEdit, In which the encryption key will be entered.
- QPushButton, In the slot of the click handler of which, data encryption / decryption will be performed. Again, I note that the method will be used the same.
The program will look like this:

Qt → Qt/C++ - Tutorial 068. Hello World using the CMAKE build system in CLion
Write "Hello, World !!!" On Qt in the IDE CLion using the CMAKE build system. The emphasis on the fact that the project is being developed in IDE CLion was made because to work with the project it is necessary to make a small adjustment for working with CMAKE .
The result is the following application:

Николай Булахтин
C++ - Тест 003. Условия и циклы
- Result:50points,
- Rating points-4
Николай Булахтин
C++ - Test 001. The first program and data types
- Result:73points,
- Rating points1
- Popular publications in the last 90 Days
- Qt - Selecting data from a QSqlQuery database in a QThread stream and creating a QAbstractTableModel model based on it1.5K
- Qt/C++ - Tutorial 088. Text search with highlighting in QTextEdit1.2K
- Django - Tutorial 041. Display images in the admin panel on the example of a user profile1.1K
- Qt/C++ Tutorial 087. Get the maximum number of multiple input fields QLineEdit939
- Django - Tutorial 043. template tags to form breadcrumb with shema.org support806
Vlad15007
QML - Lesson 004. Signals and Slots in Qt QML
Александр90
Qt/C++ - Lesson 026. Using CallBack function
Александр90
Qt/C++ - Lesson 026. Using CallBack function

Михаиллл
Qt/C++ - Lesson 036. QWebView – How to make simple browser on the Qt

Евгений Легоцкой
Qt/C++ - Lesson 036. QWebView – How to make simple browser on the Qt

IscanderChe
QSqlTableModel + QTableView + кастомный делегат в виде чекбокса

Евгений Легоцкой
Как повернуть расположенные в QTabWidget элементы на 90 градусов?

Евгений Легоцкой
Можно ли использовать классы QTcpServer/QTcpSocket для взаимодействия с android-сервисом?
mr_roman
Не удается запустить акселерометр в android-сервисе

Евгений Легоцкой
For registered users on the site there is a minimum amount of advertising