Show HN: Encrypt any file in your PC with this little tool (github.com) 1 points by Drimiteros 1y ago ↗ HN
[–] theandrewbailey 1y 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.
1 comment
[ 3.7 ms ] story [ 11.6 ms ] thread