AETERNAE AI RESEARCH LLC INDEPENDENT RESEARCH
ÆAETERNAERESEARCH
Sign inRequest access
← Malware catalog

Attributed metadata history

REPORTPUBLIC METADATA

Implementing a Levenshtein Distance Function in KQL

The Levenshtein Distance, was introduced by Russian mathematician Vladimir Levenshtein in 1965 to measure the difference between two sequences of characters. Specifically, it calculates the minimum number of single-character operations needed to transform one string into another. Those operations can be:Insertion: Adding a character (cat → catt)Deletion: Removing a character (cat → ca)Substitution: Changing one character to another (cat → bat)The distance metric effectively represents how similar two strings are. A distance of 0 means the strings are identical, while a larger distance indicates greater differences between the strings. The Levenshtein Distance has a wide range of applications, including spell checking, autocorrection, and fuzzy search.The AlgorithmTo calculate the Levenshtein Distance, we need to build a matrix that keeps track of the minimum number of operations required to transform one string into another. We’ll go through the algorithm using an example. Suppose that we want to calculate the distance between the words plane and lines. The process goes as follows:Step 1. Matrix InitializationFirst, we create a matrix with dimensions (m+1) * (n+1), where m and n are the lengths of the two strings being compared. We place the characters of the first string along the rows and the characters of the second string along the columns. We also add an extra first row and first column to represent the empty string (“”). “” l i n e s ±------------------ “” | . . . . . . p | . . . . . . l | . . . . . . a | . . . . . . n | . . . . . . e | . . . . . .Next, initialize the first row and first column incrementally, starting from 0. “” l i n e s ±------------------ “” | 0 1 2 3 4 5 p | 1 . . . . . l | 2 . . . . . a | 3 . . . . . n | 4 . . . . . e | 5 . . . . .Step 2. Fill in the matrixWe process the matrix one cell at a time, from left to right and top to bottom. For each cell, we calculate the minimum cost of the three possible operations:Deletion: The value of the cell above plus 1.Insertion: The value of the cell to the left plus 1.Substitution: The value of the diagonally upper-left cell plus 0 if the two characters match, or plus 1 if they differ.In mathematical terms, each cell is calculated using the following conditions:Levenshtein Distance cost calculationFor the substitution operation c=0 if the characters being compared are identical, and c=1 otherwise.Let’s look at the first cell, where we compare p and l. For this cell:Deletion costs 1 + 1 = 2Insertion costs 1 + 1 = 2Substitution costs 0 + 1 = 1 (because p and l are different)The minimum value is 1, so we place 1 in the cell. “” l i n e s ±------------------“” | 0 1 2 3 4 5 p | 1 1 . . . . l | 2 . . . . . a | 3 . . . . . n | 4 . . . . . e | 5 . . . . .After filling in the remaining cells in the first row we move on to the second row, comparing this time l with l. For this cell:Deletion costs 1 + 1 = 2Insertion costs 2 + 1 = 3Substitution costs 1 + 0 = 1 (because l and l are identical)The minimum value is 1, so we place 1 in the cell “” l i n e s ±------------------“” | 0 1 2 3 4 5p | 1 1 2 3 4 5l | 2 1 . . . .a | 3 . . . . .n | 4 . . . . .e | 5 . . . . .We proceed in a similar manner filling in all the remaining cells and rows. “” l i n e s ±------------------“” | 0 1 2 3 4 5 p | 1 1 2 3 4 5 l | 2 1 2 3 4 5 a | 3 2 2 3 4 5 n | 4 3 3 2 3 4 e | 5 4 4 3 2 3Step 3. Calculate the distance and operations requiredOnce the matrix is completely filled, the Levenshtein Distance is given by the value of the bottom-right cell. In this case the distance is&nb

Reference details

Source category
research-report
First reported
Dec 01, 2026 08:30 UTC
Last reported
Dec 01, 2026 08:30 UTC
Catalog updated
Dec 01, 2026 14:08 UTC
Record ID
cb28816f3b88899b38a61af94ccf3c0e1ccb899bd184b54cf5aa8956bac8f449

Published indicators

Network indicators are visibly defanged. This page does not make them clickable or send them to another service.

No validated file hashes or network indicators are stored for this record.

Source observations

intelligence_src_f9879f264b7a8ec1d7

Source-provided label
Publisher RSS metadata
Evidence class
mentioned in report
Confidence
Not reported
Observed
Dec 01, 2026 08:30 UTC
Retrieved
Dec 01, 2026 14:08 UTC

This record contains metadata and attribution only. It does not host, download, unpack, render, or execute malware samples.

Feed collection status

Sources represented on this page. Publication and observation dates describe the content; successful batch dates describe local collection. A recent batch does not certify complete coverage or current provider availability.

1 sources: 0 stale, 0 needing attention, 0 paused, 0 unverified.

Review source update dates and status
  • intelligence_src_f9879f264b7a8ec1d7Recent successful batchLast successful batch: Last attempt:

Stale means older than twice the recorded collection interval, with a minimum of one hour; without an interval, the threshold is 24 hours. Cached content remains available while a feed is stale, paused, or unverified.