A security apparatus for validating an authorization for locking and unlocking and/or using an object, comprising a control device and a memory arranged in the object, said control device being connected to at least one transmit and receive unit, wherein the transmit and receive unit is operable to transmit a request signal to a remote code generator when initiated by the control device, wherein the control device is further operable to calculate a distance of the code generator to the respective transmit and receive unit and operable to determine an authorization, wherein if an authorization is present and confirmed depending on a relevant distance of the code generator from the object or motor vehicle and depending on a location in a relevant detection zone around the object or motor vehicle, at least the control device is operable to output a control command in the object or motor vehicle, wherein the apparatus comprises means to analyze a reply signal from the code generator, and means to calculate an associated quality value by a mathematical function in each case for the measuring results of said distance measurements, wherein only those measured values which fall below a certain quality value as a threshold value are accepted for an analysis in respect of initiating a distance-related function and wherein adjustment parameters and threshold values for the quality criterion and/or a level are permanently stored in the memory of the security apparatus.