<?xml version="1.0" encoding="UTF-8"?>
<article article-type="Research Article">
  <front>
    <journal-meta>
      <journal-id journal-id-type="publisher">journal-of-discrete-mathematical-sciences-and-cryptography</journal-id>
      <journal-title-group>
        <journal-title>Journal of Discrete Mathematical Sciences and Cryptography</journal-title>
      </journal-title-group>
      <issn publication-format="electronic">2169-0065</issn>
      <issn publication-format="print">0972-0529</issn>
      <publisher>
        <publisher-name>Taru Publications</publisher-name>
      </publisher>
    </journal-meta>
    <article-meta>
      <article-id pub-id-type="doi">10.47974/JDMSC-3092</article-id>
      <title-group>
        <article-title>Adaptive semantic guardrails : Dynamic magic square obfuscation as a positional cipher for NL2SQL environments</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author" corresp="yes">
          <name>
            <surname>Sharma</surname>
            <given-names>Rahul Kumar</given-names>
          </name>
          <aff>School of Computer Science &amp; Information Technology (SCSIT), Devi Ahilya Vishwavidyalaya, Indore, Madhya Pradesh, 452001, India</aff>
        </contrib>
        <contrib contrib-type="author">
          <name>
            <surname>Kapoor</surname>
            <given-names>Vivek</given-names>
          </name>
          <aff>Department of Information Technology, Institute of Engineering &amp; Technology, Devi Ahilya Vishwavidyalaya, Indore, Madhya Pradesh, 452017, India</aff>
        </contrib>
      </contrib-group>
      <volume>29</volume>
      <issue>10-C</issue>
      <fpage>4787</fpage>
      <lpage>4794</lpage>
      <pub-date date-type="pub">
        <day>31</day>
        <month>10</month>
        <year>2026</year>
      </pub-date>
      <abstract>
        <p>Natural Language to SQL (NL2SQL) interfaces has made data far more accessible, but they have also opened up a new kind of weakness we call “Semantic Drift.” Because these systems are probabilistic, a Large Language Model (LLM) can produce SQL that is syntactically correctyet still breaks implicit privacy rules through hallucination or adversarial prompt injection. Conventional, deterministic security models are not built for this: they check identity, not semantic intent. To close that gap, we apply discrete combinatorial mathematics—specifically, dynamically generated Magic Squares—to build a positional symmetric cipher that functions as an adaptive Moving Target Defense (MTD). A Tri-State Decision Engine sits inside transparent JDBC middleware, balancing data integrity against active defense. When a query looks anomalous, the system responds with high-entropy obfuscation generated through the Siamese method, scrambling sensitive data on the fly and defeating frequency analysis in the process. In our evaluation, this approach caught 97.4% of adversarial injections while adding only 6.8ms of latency overhead, pointing toward a new cryptographic standard for zero-trust database connectivity in AI-driven systems.</p>
      </abstract>
      <kwd-group>
        <kwd>Cryptography</kwd>
        <kwd>Magic squares</kwd>
        <kwd>Moving target defense</kwd>
        <kwd>Positional cipher</kwd>
        <kwd>Information entropy</kwd>
        <kwd>NL2SQL</kwd>
        <kwd>Semantic drift</kwd>
      </kwd-group>
      <custom-meta-group>
        <custom-meta>
          <meta-name>access</meta-name>
          <meta-value>open</meta-value>
        </custom-meta>
        <custom-meta>
          <meta-name>retracted</meta-name>
          <meta-value>no</meta-value>
        </custom-meta>
      </custom-meta-group>
    </article-meta>
  </front>
</article>
