Firstly, you're talking about 'padding'
http://en.wikipedia.org/wiki/Padding_%28cryptography%29
but what you probably want to do is (since you arent doing anything)
http://en.wikipedia.org/wiki/Substitution_cipher
Secondly: altho I am happy to see someone that is learning by testing, i'd recomend you to read the cpp tutorial on this site.
Thirdly:
and this goes to helios: it was prolly a typo, he ment char* y = new char[x];
Anyway thats not the way to do it...
Let me help you out a bit, here is a psevdocode to what you want to do:
function encrypt:
open file
read a block of data from it (lets say 1024chars) and store it into an tmp var
for every char in the block:
char XOR value
write it back or add to an array of blocks (create a vector<char[1024]*> blocks)
function decrypt:
same as encrypt :)
You can later save back all blocks in the vector with your save function, but first have a look at
http://www.cplusplus.com/reference/iostream/fstream/
Notice that I've changed the algorithm to an simpler, xor algorithm, which is better- just use long strings to xor with, or even files.
About the 'value', you can read a string as a password than xor the file with that string (you xor a char at a time, you will have to calc which position in the string youre using)
You can always just set it to a hardcoded value, but a single char is eazily breakable with brute force .
Hope I helped.
EDIT: Had this site opened for a bit so I ditnt see chris posting:) btw chris, you're a long way from britain! Since you're posting here I imagine you're bored, go swimming or something