Oct. 16, 2023, 11:43 a.m. | LiwenWang

DEV Community dev.to




Can regular expressions be encrypted?


Yes, you can. At least it can be confirmed that it is possible in JavaScript programming.





What is the use of regular expression encryption?


You can hide some important and private string contents, making the logic and secrets of the code less vulnerable to prying eyes.


Regular expression encryption example





Example



var reg = new RegExp("hello","g");



After being encrypted by JShaman JavaScript Obfuscator, this line of JS code can become the following form.



var reg=new …

code encrypted encryption expressions hide important javascript logic making private programming prying eyes regular regular expression regular expressions secrets vulnerable webdev what is yes

Cybersecurity Consultant

@ Devoteam | Cité Mahrajène, Tunisia

GTI Manager of Cybersecurity Operations

@ Grant Thornton | Phoenix, AZ, United States

(Senior) Director of Information Governance, Risk, and Compliance

@ SIXT | Munich, Germany

Information System Security Engineer

@ Space Dynamics Laboratory | North Logan, UT

Intelligence Specialist (Threat/DCO) - Level 3

@ Constellation Technologies | Fort Meade, MD

Cybersecurity GRC Specialist (On-site)

@ EnerSys | Reading, PA, US, 19605