News for hackers. Stuff that matters.
Re:Show HN: Encrypt any file in your PC with this little tool by theandrewbailey on Sunday February 23, 2025 @01:40PM (#43151831)

    //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.

There are no comments on this comment yet.