4 ms·
Show HN: Encrypt any file in your PC with this little tool
- theandrewbailey 2y ago//Process file in chunks while (file.read(reinterpret_cast<char\*>(buffer.data()), buffer.size()) || file.gcount() > 0) { size_t bytesRead = file.gcount(); for (size_t i = 0; i < bytesRead; i++) { //Encrypt if (choice == 1) buffer[i] = buffer[i] + key; //Decrypt if (choice == 2) buffer[i] = buffer[i] - key; Might be OK for a CS 101 course, but a Caeser cipher is a rather bad encryption algorithm.