Preprint
Article

This version is not peer-reviewed.

Design of Functionally Graded Alloys for Locks Highly Resistant to Ultrasonic Detector Attacks

Submitted:

23 April 2026

Posted:

27 April 2026

You are already at the latest version

Abstract
Mechanical locks were not quickly supplanted by electric locks. They are still being researched and improved, along with advanced electronic methods of attack. Reading pin lengths by detecting their natural frequencies (lock decoding) to forge a copy of the legitimate key can be done quickly using ultrasonic detectors, active or passive. Hence, advanced methods of defence must be further researched. One method is to make the lock’s pins out of functionally graded materials (FGM). A pin’s natural frequency (in the range 100 kHz-1 MHz) and hence its ultrasonic pulse transit/reflection time can be correlated to its length if it is made of a homogeneous material. The idea is to design pins made of functionally graded alloys, to achieve equal natural frequencies, but also desired positions of standing wave nodes regardless of the pin’s length. Mathematical models of pins vibrations must be devised first to enable calculations of FGM alloys composition. Two simple and fast mathematical models are first derived from finite-element model (FEM) of a pin. These models are used in an optimization procedure based on the Nelder-Mead simplex method to calculate optimal profiles of Young’s modulus and density along the pin’s longitudinal axis. A successful optimization procedure for 10 key pin lengths is performed, to make a pin-tumbler lock resistant to ultrasonic attacks.
Keywords: 
;  ;  ;  ;  ;  ;  

1. Introduction

Mechanical locks have been continuously improved [1,2,3], while mechanical assemblies of electric locks still have problems to be solved. This is why mechanical locks are still an important link in the chain of security. Along with the development of mechanical locks, different attack techniques are also being improved [4,5,6,7,8]. The ultrasonic method is one of them.
The motivation for this paper is to increase mechanical locks’ resistance to active and passive ultrasonic attacks. This is not to be done by significant changes in their mechanical assemblies. Shapes and dimensions of all other mechanical components (including the driver pins) will be left the same. Only the chemical composition of the key pins will be changed. This way, a high-security lock’s protections against standard mechanical attacks [9,10,11] (e.g, bumping, picking or raking using Kopsch’s tools, mechanical decoding with "Sputnik" tool, drilling, etc.) in the form of pick-proof pins, trapping calottes (Fangkalotten) [2,3], double pins, pins in multiple planes, cascaded locks (Kaskadensystem) [3,9], anti-drilling rods, etc, will be kept, and extra protections will be added.
Active ultrasonic detectors [12] read the lock pins’ lengths by measuring the ultrasound echo delay time on the tip of a pin. Passive ultrasonic detectors [13], which are cheaper, register vibrations on a pin’s lateral surface (Figure 1) using a laser beam perpendicular to the pin. The laser microphone records pin vibrations at the pin’s impact on the plug/rotor, after the pin’s spring is compressed and abruptly released. Measured natural frequencies are then correlated to the pins’ lengths.
For both types of ultrasonic attacks to succeed, the Young’s modulus E and density ρ of key pins must be known to the attacker, and pins of different lengths must have different natural frequencies. Both key pins and driver pins on all known high-security pin-tumbler locks are always made of homogeneous metal alloys, most often brass or steel. Driver pins are all the same length, while key pins from one manufacturer are usually made in 10 standard lengths. A code defining cuts in a key to match, e.g., a particular 5-pin lock is, for example, 2-4-6-5-8. This is why it’s easy to correlate a key pin’s natural frequency to its length, which makes every such lock vulnerable to ultrasonic attacks.
A lock resistant to ultrasonic attacks should have key pins with equal natural frequencies regardless of their lengths. Furthermore, the passive ultrasonic attack won’t succeed if the laser probe is pointed at an area on a pin close to a standing wave node. This is why the key pins should be made of alloys with variable E ( x ) and density ρ ( x ) along the pin’s longitudinal axis x.
Natural frequency f of longitudinal vibrations of a thin rod [14] of length L made of a homogeneous material is
f = 1 2 L E ρ ,
where E is Young’s modulus and ρ is density. This means that an equal frequency for all 10 pins of different lengths can be achieved with different homogeneous alloys. This is true, but this way, the positions of standing wave nodes x 0 (Figure 2) are fixed to a point x 0 < L / 2 and can’t be moved. If it’s possible to move x 0 to a point close to pin’s tapered tip, like in Figure 2, which is a spot where a laser probe will be pointing, it will be more difficult for an attacker to record a useful signal because of the small amplitude of vibrations.
Even for a homogeneous material, equation (1) is valid only if the rod can be considered "thin"(i.e, if the ratio L / d > 1.7 , for error < 0.1%), and if cross-section A ( x ) is constant. Gradient d A ( x ) / d x increases the speed of sound v ( x ) , thus increasing the frequency f and moving the node point x 0 to the left from L / 2 . Its preferred position is actually to the right, as shown in Figure 2.
In this paper, FGMs are proposed to be used for making key pins, instead of usual homogeneous alloys. FGMs have been researched since mid-1980s [15]. Many new FGMs along with new methods of manufacturing have been invented since then [16,17,18,19]. Their first significant use case was for space shuttle wings, to combine tensile strength of steel with superior high-temperature properties of ceramic materials. Simply laminating steel wings with a layer of ceramics makes the wing structure too weak, which is why a gradual transition from pure ceramics on the surface to metal in the bulk was devised to make the wing structure mechanically and thermally stronger.
FGM will improve a lock’s resistance to ultrasonic attacks, because by varying E ( x ) and ρ ( x ) along the x-axis, both pin’s natural frequency and position of standing-wave node can be manipulated. This way, it will be difficult to correlate a pin’s natural frequency to its length. The method to produce such FGM pins, i.e. 3D printing from metal powders is already well established - a so-called direct energy deposition (DED) method. It uses several different metal powders, mixed at different ratios on every point along the x-axis, to achieve the desired E ( x ) and ρ ( x ) values. The volume ratios of metal powders are calculated from E ( x ) and ρ ( x ) according to Voigt’s model.
Mechanical vibrations on FGM structures [20,21,22] have been modeled by different application-specific models, which is a further contribution of this paper, along with a method to optimize E ( x ) and ρ ( x ) profiles. This means that mathematical models of pins’ vibrations on a mechanical transmission line with variable E ( x ) , ρ ( x ) and A ( x ) have to be devised first; this is done in Section 2. Simplified models, appropriate for use in an optimization procedure (i.e, fast enough to calculate 500-1000 successive simulations in a reasonable time) have been derived, in Section 3. Initial calculations for pins with two distinct sections ( E ( x ) and ρ ( x ) as step functions) as a starting point for the optimization procedure (to reach set referent values both for f and x 0 ) are done in Section 4, along with the transition to gradual E ( x ) and ρ ( x ) derived from Butterworth polynomials. An optimization procedure to calculate the optimal E ( x ) and ρ ( x ) profiles is defined and performed in Section 5. Final adjustments to ameliorate the resistance against ultrasonic attacks (by compensating for short stick effects and introducing some random variables) are performed in Section 6.

2. Mathematical Models of Pins Vibrations

Key pins excited by an axial impulse (from a piezo transducer probe of an active ultrasonic decoder, or an impact with a plug/rotor in front of a laser probe of a passive ultrasonic decoder) behave as a mechanical transmission line with free ends. Both ends of the key pins are not affixed, and the loading spring is very soft compared to a metal pin; hence, the termination impedance can be considered practically infinite at both ends. According to [23], the error in natural frequency of one-dimensional thin-rod axial model is less than -2.7% for the smallest key pins (i.e, for pins with ratio L / d = 1.4 , which is the lowest value among all standard pin-tumbler locks). The difference in natural frequencies between the two shortest standard pin lengths (pin-1 and pin-2, pin numbering goes up to pin-10 for the longest pin, for a lock with 10 pin lengths) is usually higher than 10%.
Partial differential equation (PDE) for one-dimensional mechanical line (shown in Figure 3 - K is stiffness in [N/m] of a line segment of width Δ x , A is cross-section area, F is force on segment Δ x , Δ m is its mass, D is a damping coefficient in [Ns/m], and ξ is a dimensionless damping factor) [21,24] with variable parameters (2) can’t be solved analytically in the general case.
x E x A x u x , t x = ρ x A x 2 u x , t t 2
Damping factor ξ for metallic alloys is very low (in the order of 10 3 ), hence its term in (2) is neglected. It has no influence on the natural frequency and position of standing wave nodes. Equation (2) is then written in a more appropriate form:
E A x x u ( x , t ) x + E A ( x ) 2 u ( x , t ) x 2 = ρ A x 2 u ( x , t ) t 2
E A x = E x A ( x ) , ρ A x = ρ x A ( x )

2.1. FEM Model

FEM models are accurate, but slow. A FEM model is coded in MATLAB to be used as a reference for the evaluation of faster and simplified models designed in Section 3. Sampling time is Δ t = T d , number of finite elements is N = 500 , pin length is L, length of one FEM segment is Δ x = L / N = l . Signal u ( x , t ) discretized in space and time is u ( j , k ) . Using standard Euler’s approximations for derivatives, the following equations (4)-(6) derived from (3) will define the FEM model.
u j , k + 1 = w 2 v 2 j u j + 1 , k + w 2 v 2 j ·
· a j 2 + 2 · u j , k + w 2 v 2 j 1 a j ·
· u j 1 , k u ( j , k 1 )
w = T d l , a j = 1 E j 1 A ( j 1 ) E j A ( j )
v ( j ) = E ( j ) ρ ( j ) , x ( j ) = j L N = j l
The boundary condition for the left-hand ( j = 1 ) free end excited by impact force F 1 is described by (7), and analogously for the right-hand free end ( j = N ).
u 1 , k + 1 = F 1 k + u 2 , k u ( 1 , k ) E 1 A 1 l T d 2 ρ 1 A 1 l +
+ 2 u 1 , k u 1 , k 1
A condition (8) for a minimum sampling time T d is required for a stable FEM simulation.
T d < min j ρ ( j ) E ( j ) l

2.2. Some Exact Solutions of the PDE

Variables x and t can always be separated, because standing waves will be formed on a line with two free ends. Furthermore, the amplitude U ( x ) is important for optimization, not the instantaneous value of the longitudinal vibrations u ( x , t ) = U ( x ) e x p ( i ω t ) . Boundary conditions will thus always be d U ( 0 ) / d x = 0 and d U ( L ) / d x = 0 . For the simplest case, i.e, a thin pin with constant E, ρ , and A, the natural frequency is (1).

2.2.1. Constant E 0 and ρ 0 , Exponential A ( x )

For a pin with cross-section described with an exponential function A ( x ) = A 0 e x p ( h x ) , and constant E and ρ , the exact natural frequency can be calculated by analytical solution of (3):
f = 1 2 L E 0 ρ 0 1 + h 2 L 2 4 π 2
This natural frequency is always higher than for the constant cross-section (1). This indicates that the gradient d A ( x ) / d x increases the propagation speed v ( x ) in the same material.

2.2.2. Constant A 0 , Exponential E ( x ) and ρ ( x )

For the Young modulus and density described as E ( x ) = E 0 e x p ( a x ) , ρ ( x ) = ρ 0 e x p ( c x ) , the propagation speed and natural frequency can also be calculated by analytical solution of equation (3):
v ( x ) = E 0 ρ 0 · e x p a c 2 x
f = c a 4 E 0 ρ 0 · 1 e x p c a 2 L 1
These equations can also be analytically calculated by integration of time T 2 = 0 L d x v ( x ) , which will be a basis for devising fast and simple models of FGM key pins vibrations in next section.

3. Fast Mathematical Models for Optimization of FGM Key Pins Profiles

Starting from PDE (3) and the standing wave equation u ( x , t ) = U ( x ) e x p ( i ω t ) , the ordinary differential equation (ODE) (12) is derived:
d 2 U x d x 2 = d E A x d x 1 E A x d U x d x ω 2 ρ A x E A x U x
This is not analytically solvable for every E A ( x ) and ρ A ( x ) function. However, for a known E A ( x ) and ρ A ( x ) , the solution (f and x 0 ) can be found with sufficient precision with less than 10 successive simulations, using a Simulink model in Figure 4. Variable x is treated as time. Integrators work with 4th order Runge-Kutta with constant time step (actually the FEM element length l = L / N ). Initial value on integrator U ( 0 ) is set to any max value (1 μ m in this case), and on the other integrator to U ( 0 ) = 0 (this is one boundary condition). Hence, if ω = 2 π f is set to the pin’s correct natural frequency, the second boundary condition U ( L ) = 0 will be met at the end of the simulation (Figure 5b) for f=476 kHz. The standing wave node position x 0 = 2.92 mm is then read directly from U ( x ) in Figure 5a.
One Simulink simulation takes 0.3 seconds, which means 3 seconds will be needed to establish x 0 , f and U ( x ) profile. This is 10 times faster than one FEM model simulation in Matlab (cca. 30 seconds). This model is more useful for checking f and x 0 calculated by some other method, because it is then 100 times faster than FEM, and its precision (i.e, f, x 0 and U ( x ) ) is the same as FEM’s. However, a faster model will be needed for FGM pins’ profile optimization procedure, since 500-1000 successive simulations are needed in simplex optimization of one pin to reach an optimum profile.

3.1. Speed Profile v ( x ) Approximation

If A ( x ) = A 0 is constant, the ultrasound speed at point x can be calculated as v x = E ( x ) / ρ ( x ) . Natural frequency f = 1 / T , and standing wave node position x 0 , similarly to (11), can then be calculated by numerical integration of time (13):
T 2 = 0 L d x v ( x ) , T 4 = 0 x 0 d x v ( x ) = x 0 L d x v x
The influence of d A ( x ) / d x along with E ( x ) and ρ ( x ) on speed v ( x ) is difficult to calculate analytically. The main idea is to approximate the increase of speed v x = E ( x ) / ρ ( x ) at the pin’s tip (where d A ( x ) / d x 0 ) accurately enough, then (13) can be used as a fast model for optimization procedure. This way, f and x 0 can be quickly calculated using (13), and then model (12) can be used to calculate U ( x ) and to confirm the values of f and x 0 . The simplest approach is to use an exponential function (14), where v a x = E ( x ) / ρ ( x ) , as a speed correction factor at the tip ( x > L 1 ).
v ( x ) = v a ( x ) e x p ( b ( x L 1 ) )
Even if v ( x ) thus doesn’t match exactly at every point on the x-axis, but f and x 0 match the ODE model (12), this will be precise enough for the pin optimization procedure. For a pin of certain dimensions (length L, and a tip of constant dimensions for all 10 standard lengths of a particular lock manufacturer), it will be shown that coefficient b = b ( L ) can be calculated to achieve sufficient precision. Standard key pins of the locksmithing company Schlage will be further used as a case study.

3.2. Calculation of b Coefficient

Two straight lines and one circular arc approximate the tip of a standard Schlage key pin, Figure 6. The coefficient b was calculated for 10 homogeneous pins (made of brass, v ( x ) = v 0 = 3870 m/s). Then it will be shown that this exponential correction of speed is also accurate for arbitrary variable E ( x ) and ρ ( x ) . Pulse propagation time from x = 0 to x = L is:
t L = 0 L d x v ( x ) = 0 L 1 d x v 0 + L 1 L d x v 0 e x p ( b ( x L 1 ) ) =
= L 1 v 0 + 1 b v 0 1 e x p ( b ( L L 1 ) ) = T / 2 ,
where natural frequency is f = 1 / T , propagation time from one end to standing wave node is t ( x 0 ) = t ( L ) / 2 , and x 0 = v 0 · t ( x 0 ) for x 0 < L 1 .
The following substitutions will be introduced (16). The length of a tip d s c h = 1.4 mm is constant for all 10 pins; L C is dependent on L.
d s c h = L L 1 , L C = 1 b 1 e x p ( b ( L L 1 ) )
From (15) and (16), the implicit equation (18) is derived.
f = v 0 2 · 1 L 1 + L C , x 0 = 1 2 L 1 + L C
b = 1 v 0 / ( 2 f ) L 1 1 e x p ( b d s c h )
Equation (18) will be used to iteratively calculate the value of b according to the following procedure:
1.) For a standard pin length L, and A ( x ) = d 2 ( x ) π / 4 with d ( x ) according to Figure 6, run a Simulink simulation according to (12) and Figure 4. This yields f and x 0 .
2.) Using f, iteratively calculate b = b ( L ) from (18)
3.) Calculate L C = L C ( b ) from (16)
4.) Take the next standard value for L and go to step 1.
This way, for 10 standard Schlage pin lengths,
L[mm]=[4.19 4.57 4.95 5.33 5.72 6.10 6.48 6.86 7.24 7.62]
The following values of b and L C are obtained:
b[ m 1 ]=[516 520 52 4 528 532 537 541 545 549 553]
L C [mm]=[1.00 1.00 0.99 0.99 0.98 0.98 0.98 0.97 0.97 0.97]

3.3. Comparison of Two ODE Models

Approximation of initial ODE model (12) with variable A ( x ) , E ( x ) and ρ ( x ) (called "A" model) is compared with the ODE model with constant cross-section A ( x ) = A 0 , and variable E ( x ) and ρ ( x ) (called "v" model). In the second model, the E ( x ) will be multiplied by the factor e x p ( b ( x L 1 ) ) for x > L 1 , and ρ ( x ) will be divided by the same factor, which will effectively multiply the speed v x = E ( x ) / ρ ( x ) by that factor along the pin’s tip.

3.3.1. Natural Frequencies of Brass Schlage Pins

Pins are homogeneous, made of brass ( E 0 =120 GPa, ρ 0 =8000 kg/m3). The results of simulations of ODE models "A" and "v" in Figure 7 show that there are very small differences between models (maximum frequency error is 0.88 kHz, and maximum standing wave node position error is 0.015 mm) for homogeneous pins. For comparison, ODE model simulations of cylindrical pins (such as driver pins, without tapered tips) are also performed, showing that the frequency error increases up to 10% (for pin-1) if the tapered tips are neglected.

3.3.2. Comparison of "A" and "v" Models of FGM Pins

ODE models simulations are performed for an FGM pin of length L = 6.86 mm, as in the previous subsection. The natural frequency of the pin is f = 364 kHz, the node position is x 0 =3.98 mm, and the accuracy remains the same. Variable E ( x ) and ρ ( x ) in Figure 8 are shown multiplied by factor A ( x ) / A 0 for the "A" model, and with the exponential factor for "v" model. Both ODE models also show equally high accuracy compared with the FEM model.
On the other hand, as it’s shown in Figure 8a, the ratio of the maximum and minimum value of E A ( x ) of the "A" model can be much higher than the ratio of respective values of the "v" model. This can increase numeric errors at ODE model integrators on the "A" model. This is why, for certain E ( x ) profiles, the accuracy of the "A" model decreases compared to FEM and "v" models.

3.4. Testing of Fast Time Integrator Model

Since the accuracy of the ODE "v" model is confirmed, and hence the accuracy of speed correction with the exponential factor, the fast time integrator model (13) can now be tested for accuracy, since it uses that same approximation. For a pin with E v ( x ) and ρ v ( x ) profiles as in Figure 8, the fast time integrator model results are f=403 kHz, and x 0 =4.07 mm. Therefore, the frequency error is >10%.
On the other hand, for a pin with E v ( x ) and ρ v ( x ) profiles as in Figure 9 (transition points of both E and ρ are now close to x 0 ), accuracy is much better. ODE "v" model gives f=476.7 kHz, x 0 =4.43 mm, while the fast time integrator gives f=476.2 kHz, x 0 =4.43 mm.
The accuracy of this model increases as transition points approach the standing wave node. However, it will be shown (in Section 5) that it’s possible to set the optimization objective and penalty functions so that node position x 0 falls close to both transition points at the end of the optimization procedure.
This model is still accurate enough for the optimization procedure and the most appropriate for it. It can complete 1000 simulations in MATLAB in 3 seconds. When the optimum point is reached, the final result can be double-checked and confirmed by one simulation using the ODE "v" model.

4. Initial Calculations for FGM Pins

There is more than one way to achieve the optimization objective, but the simplex method’s convergence is not always guaranteed. This is why its initial vectors must be properly set. The following procedure will be described, which achieves reliable convergence.

4.1. Setting the Initial Parameters for Optimization

Setting the initial parameters for optimization is performed according to the following algorithm:
1.) A desired distance of the standing wave node from the pin cone d 0 = L 1 x 0 is first set. Let d 0 = 1 mm.
2.) Calculate (according to (16)-(18)), for a homogeneous pin (e.g, made of brass, like in subsection 3.2), length L r e f = L C + 2 d 0 + d s c h =4.395 mm (since L C depends on L, a few iterations may be needed).
3.) For this L r e f , also according to (18), calculate f = v 2 / 2 / ( L r e f d s c h + L C ) = 476 kHz, for v 2 defined by initial homogeneuous material (brass), i.e, 3800 m/s.
This is not the length of a standard Schlage pin (it falls between pin-1 and pin-2). It will be used to set a reference for natural frequency (476 kHz) and node position ( d 0 =1 mm left from the tapered tip). The idea is to keep the right-hand side the same (made of brass), and change the composition of the homogeneous alloy on the left-hand side (e.g, like Figure 10), so its speed of sound v 1 satisfies the equation:
v 1 L d 0 d s c h = v 2 L r e f d 0 d s c h
4.) This way, the wave propagation time on the left-hand side remains the same, keeping the frequency f and node position d 0 = L 1 x 0 unchanged, for every standard pin of length L:
L[mm]=
[ 4.19 4.57 4.95 5.33 5.72 6.10 6.48 6.86 7.24 7.62 ]
v 1 [km/s]=
[ 3.41 4.13 4.86 5.58 6.32 7.05 7.77 8.50 9.22 9.95 ]
FEM simulations confirm this approach; natural frequency and node positions remain the same for all 10 standard lengths.

4.2. Using Butterworth Polynomials to Improve the Structure

A structure like that in Figure 10, with an abrupt transition, may be difficult to implement in practice. The reason is a problem with achieving sufficient adhesion along the separation plane ( x = L 2 ), along with a possible problem of fitting their different crystal grids. Furthermore, when attacked with an active ultrasonic detector (ultrasonic pulse injected at the pin’s tip x = L ), there will be a reflection from the separation plane ( x = L 2 ), and then another from the flat, left-hand end ( x = 0 ). Their delay times will be equal for any pin length, but the ratio of amplitudes and phases of these two reflected pulses will be different for different materials on left-hand side. This is another reason why the transition must be made gradually (a gradual transition won’t create reflections), so it can be realized using methods like 3D printing/sintering from metal powders.
Butterworth polynomials magnitudes (20) will be used to implement gradual transitions of E ( x ) (in Figure 11), and analogously, ρ ( x ) as well. The transitions are thus located in the bulk, not close to surface like in usual planar FGM structures described in [15].
E x = E 1 1 + x x 1 E 2 n E 1 + x x 2 E 2 n E , ρ x = ρ 1 1 + x x 1 ρ 2 n ρ 1 + x x 2 ρ 2 n ρ
E 2 = E 1 x 2 E x 1 E 2 n E , ρ 2 = ρ 1 x 2 ρ x 1 ρ 2 n ρ
Equations (20) are magnitudes of Butterworth filter transfer functions, with ±3 dB points at x 1 and x 2 . Their exponents n E and n ρ , however, don’t have to be integers. To estimate the width of the transition region Δ x t r a n s for profile E ( x ) (to set maximum acceptable values of exponent n E ), a tangent in the inflection point x i n f is used, in a span between E 1 and E 2 (22), and analogously for profile ρ ( x ) .
E ( x i n f ) = E 1 x i n f x 2 E x 1 E 2 n E 1 4 n E 2 1 8 n E
x i n f = x 2 E 2 n E 1 2 n E + 1 1 2 n E , Δ x t r a n s = E 2 E 1 E ( x i n f )
From (22) and (23) it can be estimated that Δ x t r a n s will be Δ x t r a n s >0.4 mm if n E , n ρ < 20 , hence it will be a bound for one of the penalty functions for simplex optimization. Standard metal powders with a particle diameter of 10 μ m are easily available to achieve a sufficiently gradual transition. Furthermore, the lower bound will be n E , n ρ > 2 , because if the exponent is too low, then the equations (21) for E 2 and ρ 2 are not valid.

4.3. Setting the Initial Vector for Simplex Optimization

The optimization vector h will be defined as follows:
h = [ Δ x E Δ x ρ x m i d ρ 1 ρ 2 E 1 E 2 ]
x 2 E = x m i d Δ x E , x 1 E = x m i d + Δ x E
x 2 ρ = x m i d Δ x ρ , x 1 ρ = x m i d + Δ x ρ
The initial values of the h vector, for every pin length L and corresponding speed v 1 calculated by (19) are (25). Value g i n f = | E ( x i n f ) | / E 1 is an acceptable gradient at the inflection point.
v 2 = 3800 m/s, ρ 2 = 8000 kg/m3, E 2 = ρ 2 v 2 2 , n = 10
ρ 1 = ρ 2 v 2 / v 1 , E 1 = E 2 v 1 / v 2 , L 2 = L d 0 d s c h , g i n f = 1500 m 1
Δ x E = L 2 ( 1 k ) , k = e x p l n ( 1 + 2 g i n f L 2 / n ) 4 n , Δ x ρ = Δ x E , x m i d = L 2 .

4.4. Approximation of E(x) and E’(x) for ODE Model

ODE "v" model requires gradient E ( x ) for simulation, to confirm the optimization result for each pin length L. To simplify E ( x ) , and especially E ( x ) for Simulink simulation, (20) will be approximated by E p ( x ) = E 1 i = 0 10 p i x i , fitted by the least-squares method.

5. Optimization of E(x) and ρ(x) Profiles

The model to be used in the simplex optimization procedure was defined in Section 3, followed by the optimization vector and its initial values in Section 4. The objective function and penalty functions are next to be defined. Since the goal is to get f and x 0 as close as possible to references f r e f =476 kHz and x 0 r e f = L d 0 d s c h for each pin length L, the main objective function is (26), with weight factors k x = 10 10 and k f = 10 6 .
F o b j = k x ( x 0 x 0 r e f ) 2 + k f ( f f r e f ) 2
First penalty function (27) is calculated from exponents n E and n ρ . These exponents are calculated in each optimization step from values in the optimization vector h, according to (21). Penalty increases when n E , n ρ < 2 or when n E , n ρ > 20 , as explained in subsection 4.2. Factors k E 1 or k ρ 1 have a value of 100 if n E <2 or n ρ <2, otherwise zero. Similarly, k E 2 or k ρ 2 have a value of 10 if n E >20 or n ρ >20, otherwise zero.
F p n = k E 1 ( n E 2 ) 2 + k E 2 ( n E 20 ) 2 +
+ k ρ 1 ( n ρ 2 ) 2 + k ρ 2 ( n ρ 20 ) 2
The following penalty function (28) is introduced because the fast time integrator model (13) used in the optimization procedure loses precision if x 0 is located outside of ( x 1 E , x 2 E ) or ( x 1 ρ , x 2 ρ ) range.
F p m = k m x 1 E + x 2 E 2 x 0 2 + k m x 1 ρ + x 2 ρ 2 x 0 2
The optimization algorithm will hence be steered to move both arithmetic mean values towards x 0 . The weight factor is set to k m = 4 · 10 8 .
Boundary values E 1 , E 2 , ρ 1 and ρ 2 must stay within some reasonable range. This is why brass (the most common material for pins in pin-tumbler locks) was chosen as the initial point, and then the ultrasound speeds v 1 for the left-hand side of each pin were calculated in Section 4 according to (19) and Figure 10. Although a much wider span of speeds of sounds is possible, ranging from 1200 m/s (common lead) to 20000 m/s (diamond), the goal is to stay within a span of common, easily obtainable metal alloys, with a sufficient minimum shear strength (in the order of a common brass, i.e, 200 GPa).
This is why a blue pentagon (Al-bronze-brass-Fe-Be) in Figure 12 is chosen as the permitted area. The following penalty function (29) will indicate if points M 1 =( E 1 , ρ 1 ) or M 2 =( E 2 , ρ 2 ) fall outside of the permitted area.
F p E ρ = k E ρ · j = 1 2 i = 1 5 P t r i a n g l e , i ( E j , ρ j ) 2 P p e n t 2 P p e n t
The weight factor is k E ρ = 2 · 10 3 . The constant P p e n t is the area of the pentagon. A sum of areas of five triangles is calculated for boundary points M 1 and M 2 . For point M 1 its five triangles are: ( M 1 -bronze-Al), ( M 1 -Al-Be), ( M 1 -Be-Fe), ( M 1 -Fe-brass), ( M 1 -brass-bronze), and likewise for point M 2 . If both boundary points are located within the pentagon, the sum of the areas of the five triangles equals the pentagon area, and the penalty function is zero. If a boundary point is located outside the pentagon, the sum of the areas of the five triangles is greater than the pentagon area, and the penalty function value (29) increases accordingly.
The cumulative penalty function is then calculated as a sum F p = F p n + F p m + F p E ρ .
According to [15] and [25], both Young’s modulus and density of a metal alloy (and a metal-ceramic composite as well) can be calculated (30) based on a simple rule-of-mixture with volume fractions ϕ i as weight factors, assuming additivity of volume (Voigt model). The Voigt model is reasonably accurate for metal alloys and metal-ceramic composites, but not for porous materials [26], for which a more precise model (Mori-Tanaka [15]) must be used. This means that any (E, ρ ) combination within any triangle in Figure 12. can be achieved by a certain mixture of three or more metals.
E ( x ) = i = 1 N ϕ i ( x ) · E i , ρ ( x ) = i = 1 N ϕ i ( x ) · ρ i
Boundaries of the pentagon in Figure 12 are set considering the following criteria:
1.) A sufficient shear strength for soft metals with E<70 GPa is difficult to achieve, hence this is one of the limits. Duralumin with 95% aluminium will have a much higher shear strength than pure aluminium, but practically the same Young’s modulus and density, according to (30).
2.) The speed of sound in beryllium is very high (v=12500 m/s), and it’s not too expensive compared to the rest of the high-security lock, since it will be used to make only key pins. If it’s acceptable to use metal-ceramic composites (which are also possible to implement as FGMs, according to [15]), possible replacements for beryllium are alumina (Al2O3, E=400 GPa, ρ =4000 kg/m3, v=10000 m/s), silicon carbide (SiC, E=400 GPa, ρ =3150 kg/m3, v=11250 m/s) or boron carbide (B4C, E=450 GPa, ρ =2500 kg/m3, v=13400 m/s). According to [27] and [28], alloys of beryllium, aluminium and iron are feasible in any ratio.
3.) The purpose of this paper is to prove that it’s possible to calculate profiles of E ( x ) and ρ ( x ) for standard key pin lengths to achieve desired f and x 0 , within a reasonable permitted range of E ( x ) and ρ ( x ) , using reasonably priced and obtainable materials, considering the advances in production of various FGMs. The exact composition of pins’ alloys (to achieve a minimum shear strength and other important properties) and the proper method of production (e.g, 3D printing and sintering using metal powders) are out of the scope of this paper.

5.1. Results of Optimization Procedure Using Simplex Method

The optimization procedure for all ten standard pin lengths, using the fast time integrator model (13), the objective function defined by (26), and penalty functions defined by (27)-(29), with initial values for each pin length set by (25), was performed. The resulting E ( x ) and ρ ( x ) profiles are shown in Figure 12 and Figure 13. The time needed for optimization procedure in MATLAB, for all ten pins, is cca. 30 seconds.
The initial span of speeds of sound (19) calculated for 2-section pins (Figure 10), as the initial values for simplex optimization, was 3410-9950 m/s. The speed span after the completed optimization (Figure 12) is 3350-10450 m/s, for pins with E ( x ) and ρ ( x ) modeled using Butterworth polynomials (20).
Red ’X’ symbols on Figure 12 indicate right-hand, tapered pin tips, i.e. ( E 2 , ρ 2 ) points, with properties close to brass. Black ’X’ symbols indicate left-hand ends, or ( E 1 , ρ 1 ) points. FGM pins profiles between red ’X’ and black ’X’ are described by (20) and (21).
FEM simulation tests for all ten optimized pins indicate a maximum ±0.8% deviation in natural frequency from reference f r e f =476 kHz, and a maximum ±0.05 mm deviation in positions of standing wave nodes x 0 .

6. Final Adjustments

The initial 1-dimensional FEM model, along with derived ODE and fast time integrator models, is valid for slender sticks, i.e. for L > 2 d . It can be used even in the range d < L < 2 d , but the natural frequency calculated from simulation results will thus be higher (because of short stick effects) than the actual natural frequency, according to [23]. The pin’s natural frequency, for pin-1, pin-2 and pin-3 must therefore be corrected by increasing E 1 (and consequently E 2 and every value of E ( x ) calculated by simplex optimization) and decreasing ρ 1 (and therefore ρ 2 and ρ ( x ) profile) by a certain factor k c
E c ( x ) = E ( x ) · k c , ρ c ( x ) = ρ ( x ) / k c
The speed of ultrasound is thus increased by the k c factor, effectively increasing the actual pin’s natural frequency by the k c factor. The actual pins will thus all have the same natural frequency f r e f =476 kHz, when short stick effects are compensated. According to [23], the k c factor value for Schlage pin-1 is therefore k c =1.023, for pin-2 is k c =1.011 and for pin-3 is k c =1.002. It can be neglected for all longer pins, from pin-4 to pin-10.

6.1. Introducing Random Fluctuations

Producing pins with exact E ( x ) and ρ ( x ) profiles as calculated by the simplex method (as on Figure 12) will be an additional challenge. A certain method of production (e.g, metal powder 3D printing) may produce pins with slightly different natural frequencies f, which could still be correlated to their lengths.
This can be preventively remedied by additionally correcting every pin’s E c ( x ) and ρ c ( x ) profiles with a certain random factor k r n d calculated before production of each pin.
E r n d ( x ) = E c ( x ) · k r n d , ρ r n d ( x ) = ρ c ( x ) / k r n d
If a random number generator sets k r n d at 0.95< k r n d <1.05 range, thus introducing a random ± 5 % frequency fluctuation, this may be (depending on production process tolerances) enough to fully obfuscate any possible remaining correlation between any pin’s length and its natural frequency.

7. Conclusion

Mechanical locks are an important link in the chain of security. They won’t be fully supplanted by electric locks. Simple methods for quickly defeating fingerprint ID or RFID readers, or simply bypassing electric locks have already been found. Picking mechanical locks requires more training and manual dexterity. Mechanical locks are hence still being researched and improved, along with methods of attack.
Instead of using usual homogeneous metal alloys, it is proposed to make a lock with key pins made of FGM alloys, to make the lock more resistant to ultrasonic attacks. The key pins made of FGM alloys will thus have equal natural frequencies. Furthermore, the standing wave nodes on pins will be placed in desired, the most convenient positions.
The proposed method for calculating the profiles of FGM pins using the simplex optimization procedure with the fast time integrator model (to quickly calculate f and x 0 ) derived from the ODE "v" model needs less than one minute to complete the calculations for 10 standard key pin lengths of any manufacturer. Although the original 1-dimensional PDE and FEM models can have up to cca. +3% error for the shortest pins, it can be corrected by factors for certain L / d ratios. The additional randomness (for production procedures like 3D printing) can easily be introduced to increase security.
The security of a pin-tumbler lock is increased, making it less susceptible both to active and passive ultrasonic attacks at an additional price of more expensive FGM key pins, leaving all other mechanical lock parts unchanged.
Possible types of locks for further research are wafer locks (like Japanese MIWA) or disc-tumbler locks (like DOM Diamant). Unlike pins in pin-tumbler locks, wafers and discs are 2-dimensional elements. The following challenge for research is slider locks (for example, EVVA 4KS), since sliders are 3-dimensional elements. Being 2-D and 3-D structures, mathematical models for wafers, discs and sliders will be increasingly more complicated. Methods for precise production (like 3D printing) of pins, wafers, discs or sliders made of FGM alloys will also have to be further researched and improved in order to meet the new demands.

Author Contributions

Methodology, L.M. and A.P; software, L.M.; validation, A.P. and V.Š.; resources, V.Š. and Ž.B.; writing—original draft preparation, L.M. and A.P.; writing—review and editing, L.M., A.P. and V.Š; supervision, V.Š. and Ž.B.; project administration, Ž.B.; funding acquisition, A.P and Ž.B. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.

Acknowledgments

The authors would like to express their sincere gratitude to mechanical engineer/master locksmith Mladen Perčić and physicist/metallurgist Jadranko Šubić for their contributions in preparation of this manuscript.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
FEM Finite-element model/method
FGM Functionally graded materials
DED Direct energy deposition
PDE Partial differential equation
ODE Ordinary differential equation

References

  1. Mladen Perčić, "Barrel lock for security purposes", DE19753013A1, Jun 02,1999.
  2. Michael Riesel et al, "Cross-sectional profile for a flat key or the key channel of a cylinder lock", EP3942127B1, Nov 18, 2021.
  3. Graham W. Pulford, "High-Security Mechanical Locks: An Encyclopedic Reference", London, UK, Elsevier Academic Press, 2007.
  4. Jeremy Straub, "Comparison of the impact of different key types on ease of imaging and printing for replica key production", Proceedings of SPIE Vol. 9867, 986715, 2016.
  5. Jeremy Straub, Scott Kerlin, "Consideration of techniques to mitigate the unauthorized 3D printing production of keys", Proceedings of SPIE Vol. 9869, 98690F, 2016.
  6. Rory Smith, Tilo Burghardt, " DeepKey: Towards End-to-End Physical Key Replication from a Single Photograph", in Proc. German Conf. Pattern Recognit., Stuttgart, Germany 2018, pp. 487–502.
  7. S. Ramesh, H. Ramprasad, J. Han, "Listen to Your Key: Towards Acoustics-based Physical Key Inference", Proceedings of the 21st International Workshop on Mobile Computing Systems and Applications, 2020.
  8. S. Ramesh et al, "Acoustics to the Rescue: Physical Key Inference Attack Revisited", Proceedings of the 30th USENIX Security Symposium, 2021.
  9. M. W. Tobias, "Locks, Safes and Security, an International Reference", Springfield, IL, USA, Charles C Thomas, 2002.
  10. D. Ollam, "Practical Lock Picking: A Physical Penetration Tester’s Training Guide", Waltham, MA, USA, Syngress-Elsevier, 2012.
  11. L. Matić, "A Handbook on DIY Electronic Security and Espionage", London, UK, Elektor International Media BV, 2021.
  12. Madelin SA, "M-Scan ultrasonic lock decoder", active ultrasonic lock decoding detector, 49130 Les Ponts-de-Cé, France, 2018.
  13. Matić, Luka; Draženović, Karla; Šunde, Viktor; Ban, Željko, "Some Security Aspects of Batteries and Power Electronic Converters in a Microgrid ",IEEE Access, XI (2023), 121712-121723. [CrossRef]
  14. J. R. Frederick, "Ultrasonic Engineering", Hoboken, NJ, USA, John Wiley & Sons, 1965.
  15. P.M. Pandey, S. Rathee, M. Srivastava, P.K. Jain, "Functionally Graded Materials (FGMs): Fabrication, Properties, Applications, and Advancements" (1st ed.). CRC Press. (2021). [CrossRef]
  16. U. Scheithauer et al, "Ceramic-Based 4D Components: Additive Manufacturing (AM) of Ceramic-Based Functionally Graded Materials (FGM) by Thermoplastic 3D Printing (T3DP)", Materials, 10(12), (2017). [CrossRef]
  17. L. Liu et al, "Microstructure and Mechanical Properties of Functionally Graded Materials on a Ti-6Al-4V Titanium Alloy by Laser Cladding", Materials, 18(13), (2025). [CrossRef]
  18. K. Topczewska, "Friction-Induced Thermal Effects in an FGM Layer in Contact with a Homogeneous Layer", Materials, 19(7), (2026). [CrossRef]
  19. X. Ding et al, "Simulation and Study of Manufacturing of W–Cu Functionally Graded Materials by a Selective Laser Melting Process", Metals, 14(12), (2024). [CrossRef]
  20. Kuznetsov, S.V., "Harmonic acoustic waves in FG rods with exponential inhomogeneity", Z. Angew. Math. Phys. 74, 63 (2023). [CrossRef]
  21. Kuznetsov, S.V., "Closed-form solutions for harmonic waves in functionally graded rods", Z. Angew. Math. Phys. 76, 128 (2025). [CrossRef]
  22. Vatulyan, A.O., Yurov, V.O. "Increasing the Natural Frequency of Oscillations in Functionally Graded Material Rods" In: Altenbach, H. "Current Developments in Solid Mechanics and Their Applications", vol 223. Springer, 2025. [CrossRef]
  23. Hutchinson, James R. "Axisymmetric Vibrations of a Free Finite-Length Rod", J. Acoust. Soc. Am. 51 (1972), 233–240. [CrossRef]
  24. F. Orban, "Damping of materials and members in structures", J. Phys.: Conf. Ser., vol. 268 (2011). [CrossRef]
  25. William D. Callister, "An introduction, material science and engineering", 7th edn, Department of Metallurgical Engineering, The University of Utah, Salt Lake City, USA, 2007.
  26. E.O. Olawuni, M.O. Durowoju, T.B. Asafa, "Correlation between theoretical and experimental hardness, elastic modulus of discarded aluminium piston reinforced with zirconium diboride and snail shells", SN Appl. Sci. 2, 472 (2020). [CrossRef]
  27. R.C. Ropp, "Encyclopedia of the Alkaline Earth Compounds", Chapter 12 - "Group 8 (Fe, Ru and Os) Alkaline Earth Compounds", Elsevier, 2013, Pages 911-960. [CrossRef]
  28. R.C. Ropp, "Encyclopedia of the Alkaline Earth Compounds", Chapter 6 - "Group 13 (B, Al, Ga, In and Tl) Alkaline Earth Compounds", Elsevier, 2013, Pages 481-635. [CrossRef]
Figure 1. A pin-tumbler lock and a passive ultrasonic detector.
Figure 1. A pin-tumbler lock and a passive ultrasonic detector.
Preprints 210033 g001
Figure 2. Standing wave and simplified shape of a key pin.
Figure 2. Standing wave and simplified shape of a key pin.
Preprints 210033 g002
Figure 3. A mechanical transmission line.
Figure 3. A mechanical transmission line.
Preprints 210033 g003
Figure 4. ODE model for Simulink.
Figure 4. ODE model for Simulink.
Preprints 210033 g004
Figure 5. Results of ODE model simulation (a) standing wave amplitudes for three different frequencies. (b) standing wave amplitude gradients for three different frequencies.
Figure 5. Results of ODE model simulation (a) standing wave amplitudes for three different frequencies. (b) standing wave amplitude gradients for three different frequencies.
Preprints 210033 g005
Figure 6. A key pin’s diameter profile.
Figure 6. A key pin’s diameter profile.
Preprints 210033 g006
Figure 7. Results of simulation of 3 different ODE models for 10 pin lengths, (a) natural frequencies of pins, (b) positions of standing wave nodes on pin.
Figure 7. Results of simulation of 3 different ODE models for 10 pin lengths, (a) natural frequencies of pins, (b) positions of standing wave nodes on pin.
Preprints 210033 g007
Figure 8. Variable profiles of an FGM pin. (a) Young’s modulus, (b) density.
Figure 8. Variable profiles of an FGM pin. (a) Young’s modulus, (b) density.
Preprints 210033 g008
Figure 9. Profiles of an FGM pin with a transition point at the standing wave node. (a) Young’s modulus, (b) density. Both profiles are "v" variant, with exponential correction of speed at the pin tip.
Figure 9. Profiles of an FGM pin with a transition point at the standing wave node. (a) Young’s modulus, (b) density. Both profiles are "v" variant, with exponential correction of speed at the pin tip.
Preprints 210033 g009
Figure 10. An example of a two-section key pin.
Figure 10. An example of a two-section key pin.
Preprints 210033 g010
Figure 11. A gradual transition of Young’s modulus.
Figure 11. A gradual transition of Young’s modulus.
Preprints 210033 g011
Figure 12. E- ρ diagram for optimized FGM key pins.
Figure 12. E- ρ diagram for optimized FGM key pins.
Preprints 210033 g012
Figure 13. Optimized FGM profiles for 10 pin lengths (a) E-x diagram, (b) ρ -x diagram.
Figure 13. Optimized FGM profiles for 10 pin lengths (a) E-x diagram, (b) ρ -x diagram.
Preprints 210033 g013
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.
Prerpints.org logo

Preprints.org is a free preprint server supported by MDPI in Basel, Switzerland.

Subscribe

Disclaimer

Terms of Use

Privacy Policy

Privacy Settings

© 2026 MDPI (Basel, Switzerland) unless otherwise stated