—Information accurate as of: World Update 2.0 Update
A Door Key costs 25 Wood per key to make. It allows the bearer of the key to open, close, lock and unlock the Door. Each time a Lock is deployed on a door, it is assigned, by the game, a number between one and 1,000,000, which keys made from it will acquire; unless a Door Key used on it matches that number, it will not unlock the door. To create a key, the door must be unlocked; the player goes up to their Key Lock and presses the "E" key (by default) on the lock. While any key and 25 Wood is held in inventory, a duplicate key for it can be created; pressing E on the door will not create a key if one already exists. The Lock can be removed while it is unlocked, and deploying it again will reset the number, probably rendering existing keys unusable.
Door keys must be carefully safeguarded so other players cannot gain access to your building via the door. You should make two keys for your main door. The first key is kept inside the base in a safe location. This allows for new copies of your key to be made if the second key is permanently lost or you wish to make a copy for a friend. The second key is placed in a Small Stash or Wood Storage Box in a bush, crevasse, or other hidden area outside your building. Once you return to your building, check that you haven't been followed and retrieve your Door Key for re-entry. Be sure to create a Sleeping Bag inside your building before attempting this strategy in the case the second key is misplaced or destroyed.
Redeploying your Lock and making a new key for it will regain control of your Lock should another player acquire one of your keys, or can be used to gain control of another player's Lock if you acquire one of their keys. it used to be that deploying a Lock multiple times, and making a key from it each time, increases the chance that the multiple keys in inventory will match other player's Locks, and was the basic principle behind Key Raiding back when the possible key combinations used to be 100 keys.
the way Key Raiding used to work was not simply just making an inventory of 100 keys and having a 100% chance of opening any lock. There was a random chance that a key created was a duplicate of another already made. Even with a hypothetical, impossible inventory of 100 keys, a handful of them would be duplicates, and there would be no keys to match a handful of potential locks. With 69 keys you have a ~50% chance of having at least one matching key, and every time you double your number of keys you halve the chance of failure ( 0.99^[number of keys] = [chance none match] ).
Whether keys were truly random after each craft was not known for sure.
During the early days, key raiding use to be a big problem. the 100 different combinations were an attempt to make it difficult so it would give players, who just started playing, a chance at securing their base. but even with that many combinations, players were mass producing keys to raid any base that were still using key locks and it made players reluctant to use them. it was then where the developers made the decision to nerf key raiding for good by increasing the possible combinations from 100 to 1,000,000 in the January 11th 2018 patch titled "Dev Blog 193".
But even with the Key Lock invulnerability now no longer a problem, it is still very wise to upgrade to a Code Lock and a Sheet Metal Door (or Armored Door) as soon as possible for an increased resistance against raiding in general.
Links[]
- Rust Solo Survival Key Raiding Base Takeover Free Loot Episode 5
- The History of Lock Raiding in Rust
- 11th January 2018 "Dev Blog 193" Patch Notes