I am trying to decrypt a message that was sent to me using a letter replacement algorithm (i.e. A=C, B=Z, C=F,...)

I am trying to write a program to brute force through all of the possibilities, but I am having a hard time coming up with the looping structure.

Any help would be appreciated.

Thanks,