Arcane Lock

Level & School
2nd-level abjuration
Casting Time
Action
Range
Touch
Components
V, S, M (gold dust worth 25+ GP, which the spell consumes)
Duration
Until dispelled
Classes
Wizard

You touch a closed door, window, gate, container, or hatch and magically lock it for the duration. This lock can't be unlocked by any nonmagical means. You and any creatures you designate when you cast the spell can open and close the object despite the lock. You can also set a password that, when spoken within 5 feet of the object, unlocks it for 1 minute.

Level & School
2nd-level abjuration
Casting Time
Action
Range
Touch
Components
V, S, M (gold dust worth at least 25 gp, which the spell consumes)
Duration
Until dispelled
Classes
Wizard

You touch a closed door, window, gate, chest, or other entryway, and it becomes locked for the duration. You and the creatures you designate when you cast this spell can open the object normally. You can also set a password that, when spoken within 5 feet of the object, suppresses this spell for 1 minute. Otherwise, it is impassable until it is broken or the spell is dispelled or suppressed. Casting knock on the object suppresses arcane lock for 10 minutes.

While affected by this spell, the object is more difficult to break or force open; the DC to break it or pick any locks on it increases by 10.

Arcane Lock 5.5e 2024 vs. 5e 2014 edition differences

The 2024 version states the lock can't be unlocked by nonmagical means, whereas the 2014 version increases the DC to break or pick locks by 10. The 2014 version mentions suppression by knock for 10 minutes, while the 2024 version does not. Both versions allow designated creatures to open the object.