Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am doing a project with string encryption.

The encrypted strings and a pseudo code to decrypt/encrypt (symmetric) those strings are given in a pdf. Example of one string entry: (first character always unencrypted)

crypt 'küì?ü?|-D???'; hex '6b9a8d919a93cccdd19b9393'; clear 'kernel32.dll'

...

Clear text is only given for a few strings. I need to fill in the rest.

The readable string does not "match" the hex representation. If I copy & paste it in my IDE, the hex values differ (except from first letter). So I think its best to copy the hex representation in my IDE and transform it to a string. The pseudo code for encryption is very easy and not part of the question here.

How to give a string or character array in C++ with consecutive hex representation? Solution with easy copy & paste from given pdf preferred.

Current solution with std::stringstream is not working as intended, as I get the given hex values as strings:

std::stringstream ss;

ss << std::hex <<  0x6b<< 0x9a << 0x8d << 0x91 << 0x9A << 0x93 << 0xCC << 0xCD << 0xD1 << 0x9B << 0x93 << 0x93;
question from:https://stackoverflow.com/questions/65939002/c-giving-string-as-consecutive-unreadable-characters-in-hex-value

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
249 views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...