A detective was working undercover to try to bust a suspected gang of criminals. He got invited to a fancy club that needs a password to get in, but the gang leader said that everyone will be given the password at the door to avoid any potential moles. When he gets to the entrance, the bouncer gives him a slip of paper with the following code:

RXDRJFP??XRBNLNBFVJVFPBBNJ

After a bit of thinking, he's narrowed it down to two possible ciphers but doesn't know which one it is. He asks the bouncer one question about the 2 question marks. Once the bouncer affirms his suspicions, the detective is able to figure the password out and access the meeting, where they confess their plot. He arrests everyone and gets a nice promotion.

Hint 1:

The question marks are the same letter.

• Why would the bouncer ever answer any questions?? Aug 9 '19 at 20:41
• In real life, absolutely, but this is a puzzle, so it doesn't have to be 100% realistic. In addition, it counts as a hint of sorts, as revealing those 2 letters would make solving this much easier in my opinion. Aug 9 '19 at 21:02
• Of course, it was meant as a jest, sorry if it came off as serious :) Aug 9 '19 at 21:06
• I was joking as well, LOL. Not about the hint part, though. Aug 10 '19 at 15:14

I LOVE PUZZLING STACK EXCHANGE.

The letters on the paper

are all at even-numbered positions in the alphabet; halving 'em all yields ILBIECH??LIAGFGACKEKCHAAGE and those are the letters of ILOVEPUZZLINGSTACKEXCHANGE except that letters in positions >13 have been shifted down by 13 places. (So this isn't exactly a cipher; the transformation from the original password to what's on the paper has lost some information.)

Maybe a better way to describe it:

to get what's on the paper, take the password and double all the letter positions (letting them wrap around in the obvious way).

I have to confess that it isn't obvious to me how the detective "narrowed it down to two possible ciphers", nor what the other one is.

• Put another way: All letters in the password were converted into numbers and then the numbers were doubled to form the code. In other words, all of the letters were rotated by their corresponding number. For future reference, if this isn't a true rotation cipher, what tag should I have put this as? Aug 26 '19 at 11:52
• Your "put another way" is the same as my "better way to describe it", no? I think the cipher tag is fine, or at least the nearest thing we have; it's just worth being aware that the transformation isn't a reversible one, so e.g. the messages "I LOVE YOU" and "I LOVE LOU" would be indistinguishable after doing it. Or "HIT THE ANVIL" and "HIT THE NAVVY". Or "READ THE BOOK" and "REND THE BOOK". Aug 26 '19 at 20:23

This solution is a bit of a stretch, but here it goes:

The character string contains exactly 10 unique characters (not counting the question marks). We line up the characters as they occur in the string, and number them:
R - 0, X - 1, D - 2, J - 3, F - 4, P - 5, B - 6, N - 7, L - 8, V - 9.
If we substitute these values into the original string, we get:
0120345??10678764939456673
The detective then asks, "Do the question marks represent the same character?"
The bouncer says, "Yes."
Then, through super-human computation, the detective realizes that 01203455510678764939456673 is the only possible string that is prime.