Physical security and cryptography can learn from each other, part 11367:

Hotels wisely don't put the room number on guest keycards so if someone finds your card, they'd have to exhaustively search the hotel to find the room it opens.

Some hotels now have elevators programmed to only let you call the floor for which your keycard is coded, preventing guests from wandering to other floors.

But it also means the elevator can be used as an efficient oracle to determine the floor of a found key.

In other words, restricting the elevator in this way is a bad tradeoff. It makes it harder for guests to visit their friends on other floors, but it reduces the complexity for an outsider burglar from O(|rooms|) to O(|floors|) + O(|rooms_per_floor|), a much more feasible search space.
@mattblaze I enjoy the idea, but are you sure they don't print the room number for security reasons? I was under the impression it was because they reprogrammed them when they gave them to you
@mfdeakin @mattblaze
they do program them before they hand them to you, but the reason for that is security. They could just program a specific key for every room and put the room numbers on them, but that is considered bad practice.
@duckwhistle
Given how often people lose or forget to return their key cards when they check out, having room-specific keys isn't really a logistically sound idea.
@mfdeakin @mattblaze

@mfdeakin @mattblaze It's easy enough to decide. Are hotels interested in security or in cost? If the room number was on the key, it's extra cost to manufacture, it's extra cost because you'd need twice as many to allow for losses, it's extra cost because you'd need racks to store them, it's extra cost because reception would have to sort returned keys

So instead of having the room number on the key, it's quickly handwritten on the card folder, and you'd never lose that with the key

@mfdeakin @mattblaze
They don't print the room number because they don't have a printer for the cards. (And there's probably a policy against marker pens on stationary orders, for this reason.)