Question: C++ Create and Implement a Crypto class from the UML diagram in Figure 5.4. Figure 5.4. Crypto Class m_OpSequence is a QString consisting of the
C++
Create and Implement a Crypto class from the UML diagram in Figure 5.4.
Figure 5.4. Crypto Class

m_OpSequence is a QString consisting of the characters 'p' and 's' that represent permute() and shift(). The encrypt() function applies those functions to the given string in the order that they appear in the m_OpSequence string.
Example 5.28 contains some code to test your class.
Example 5.28. src/functions/crypto-client.cpp
#include #include "crypto.h" int main() { QTextStream cout(stdout); QString str1 ("asdfghjkl;QWERTYUIOP{}}|123456&*()_+zxcvnm,,, ./?"), str2; cout C++
Crypto m Key: ushort m_OpSequence : QString m_CharSetSize: ushort m Perm: QVector + Crypto(key: ushort, opseq : QString, charsiz: ushort) +encrypt(str const QString&): QString + decrypt(str const QString&): QString shift (str: const QString&) : QString - unshift(str: const QString&) : QString - permute(str const QString&) : QString unpermute(str const QString&): QString - limitedRand(max : int): int - randomPerm(n: int): QVector
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
