# Unlocking tool

( 

Name

skeleton key

Appearance

key

Base price

10 zm

Weight

3

Material

iron

Monster use

May be used offensively by monsters.

( 

Name

lock pick

Appearance

lock pick

Base price

20 zm

Weight

4

Material

iron

Monster use

May be used offensively by monsters.

( 

Name

credit card

Appearance

credit card

Base price

10 zm

Weight

1

Material

plastic

Monster use

Will not be used by monsters.

There are three unlocking tools in NetHack: the skeleton key, the lock pick (osaku to Samurai) and the credit card. The skeleton key and the lock pick are the only items allowing you to lock and unlock doors and chests. Credit cards can only unlock doors and chests, as a reference to their popularity in films for jimmying open door locks.
NetHack has two artifact unlocking tools: The Master Key of Thievery and The Platinum Yendorian Express Card.

Contents

1 Generation
2 Effects

2.1 Usage
2.2 Onlookers
2.3 Monster use

3 Strategy
4 History
5 Variants

5.1 SLASH'EM

5.1.1 Breakage
5.1.2 Strategy

5.2 UnNetHack

6 See also
7 References

Generation
All unlocking tools are generated uncursed unless found on a bones level; since 3.6.1, they can also be found among the cursed items in the "bones" generated on some traps. 

Effects
Usage
To unlock doors, apply the unlocking tool and then choose the direction of the door. To unlock chests, apply the unlocking tool while standing on the chest and then choose "&gt;", for down or ".", for here.
The chance of successfully locking or unlocking a door depends on which tool you use, your dexterity, the type of lock, and whether or not you are a Rogue. The per-turn probabilities of success are listed in the table below. A cursed unlocking tool will also have a halved chance of success, applied after all other modifiers.

Tool

For Rogues

For non-Rogues

Door

Box

Door

Box

skeleton key

(70+Dex)%

(75+Dex)%

(70+Dex)%

(75+Dex)%

lock pick

(3*Dex + 30)%

(4*Dex + 25)%

(3*Dex)%

(4*Dex)%

credit card

(2*Dex + 20)%

(Dex + 20)%

(2*Dex)%

(Dex)%

Any weapon (bladed or not)

(not possible)

2*wldam (die size against large monsters)

(not possible)

2*wldam

For Rogues, the lock pick has a higher (un)locking chance than the key for boxes at dexterity 17 or higher, and for doors at dexterity 21 or higher (usually achievable only with gauntlets of dexterity). For non-rogues, the key is better than the lock-pick except at normally unreachable dexterity levels, and in all cases the lock-pick has better chances than the credit card.
If you have not succeeded after 50 turns, you give up. This exercises your strength if using a non-bladed weapon, and exercises dexterity if using a tool or bladed weapon; the exercise is only counted once you've succeeded or given up. each failed attempt is worth nothing alone.
When unlocking chests and boxes with bladed weapons vs. other weapons, the chance of succeeding is the same, but the effects are different. Edged weapons have a small chance of breaking on every failed unlock attempt. Non-edged weapons have a 33% chance of damaging the chest, which destroys the lock completely; in that case, all potions within are broken, along with a 33% chance of breaking every other item.
The message given varies depending on the material involved, as detailed below, and occurs in the form "A(n) 

<item> <message>!" (e.g. "An orange potion shatters!")

Material

Message

Paper

torn to shreds

Wax

crushed

Veggy

pulped

Flesh

mashed

Glass

shatters

Wood

splinters to fragments

Anything else

destroyed

Onlookers
If a watchman sees you picking a lock, he may warn you or become hostile. If a warning is given, a trap is automatically added to the door in question.
Attempting to apply a credit card at a shopkeeper or the Oracle will produce the message "No checks, no credit, no problem." Attempting to apply an unlocking tool on a visible monster (other than a disguised mimic) in any other situation will produce the message "I don't think <monster> would appreciate that.".

Monster use
Some monsters with unlocking tools in their inventories may use them to unlock doors. [1]

Strategy
Credit cards are the lightest unlocking tool, but also the slowest, and cannot re-lock objects like the others. Lock picks are the heaviest and most expensive, and for a Rogue with 18 dexterity they give a 97% chance of (un)locking a box in one turn. However, in all other circumstances, skeleton keys are faster, as well as cheaper and lighter.
Being corroded or rusted does not impede the operation of any unlocking tool; however, cursed tools have only half the chance of unlocking that uncursed tools have.
While it is possible and sometimes reasonable to kick down doors, especially when without an unlocking tool, it has some adverse consequences.

Kicking wakes up nearby monsters. This includes the fabled invisible nymph. (This can have a major effect on your game, and is one of the main reasons you might choose to avoid kicking doors.)
You cannot close and/or lock doors to partition out spawned monsters if you have kicked them down (unless you have the wizard lock spell or a wand of locking).
For characters with low Strength and Constitution, kicking can take longer, unless wearing kicking boots. (Note that for characters with high values in those physical statistics, even an unlocked door can be faster to kick down than to open naturally if approached on the diagonal, because open doors, as opposed to destroyed doors, must be approached orthogonally.)
The door might be attached to a shop closed for inventory. (You can check this by examining the square orthogonally next to the door using the : command, except in a few corner cases related to bones levels.)
Kicking doors is impossible while riding or levitating.
History
All the unlocking tools first appear in NetHack 3.0.0. In addition, the NetHack 3.0 Series had special shaped keys that fit specific locks on chests and large boxes. For example, you might see "a chest (triangular keyhole)", for example, and a "triangular key" would open its lock much more quickly than a skeleton key, but a "square key" would not fit.
Doors did not have locks of any specific shape, and the shaped keys could not open them; you had to use one of the other unlocking tools.
Keys, and the locks that they fit, were as follows in NetHack 3.0.10:

Key

Lock

round

round

square

square

triangular

triangular

oval

oval

octagonal

octagonal

hexagonal

hexagonal

cylindrical

wide

irregular

notched

conical

large round

wedge-shaped

large square

In time, the shaped keys were believed to add nothing of value to the game, and in NetHack 3.1.0 they were removed.

Variants
SLASH'EM
SLASH'EM changes unlocking tools, adding a chance of breaking[2][3], and also adding some artifact keys. Blessed unlocking tools and artifact unlocking tools will never break. 

Breakage

Tool
Breakage Chance

credit card

1/20

1/30 (tourist picking a door)

skeleton key

1/15

lockpick

1/30

1/40 (rogue)

Strategy
Since the unlocking tools now break, it is a good idea to carry more than one on your person.
There's nothing worse than locking yourself into a shop, only to have your pick break when you try to get out again!
Once you get an artifact unlocking tool, this becomes less of a problem.
Generally, you'll only need to worry about it  being  stolen.
Note that the alignment keys are available to all players who progress far enough into the game.
After this, use the key matching your alignment to avoid artifact blast, and keep the other keys in your bag of holding or in a stash.

UnNetHack
Starting with version 5.1, it is possible for UnNetHack monsters to pick up keys and use them to unlock doors.

See also
wand of opening
wand of locking
spellbook of knock
spellbook of wizard lock
The Master Key of Thievery, an artifact skeleton key
The Platinum Yendorian Express Card, an artifact credit card
Alignment key (SLASH'EM only)
References

↑ monmove.c in NetHack 3.6.0, line 43

↑ lock.c in SLASH'EM 0.0.7E7F2, line 416 boxes, chests

↑ lock.c in SLASH'EM 0.0.7E7F2, line 518 doors

This page is based on a spoiler by Dylan O'Donnell. The original license is:
Redistribution, copying, and editing of these spoilers, with or without modification, are permitted provided that the following conditions are met:

The original contributors to any spoiler must continue to be credited.
Any modifications to the spoiler must be acknowledged and credited.

This page may need to be updated for the current version of NetHack.
It may contain text specific to NetHack 3.6.0. Information on this page may be out of date.
Editors: After reviewing this page and making necessary edits, please change the {{nethack-360}} tag to the current version's tag or {{noversion}} as appropriate.

</monster></message></item>