{"id":525,"date":"2013-01-24T11:45:53","date_gmt":"2013-01-24T09:45:53","guid":{"rendered":"https:\/\/www.asafety.fr\/?p=525"},"modified":"2015-11-11T02:02:15","modified_gmt":"2015-11-11T00:02:15","slug":"dechiffrement-dobjets-mssql-2000-2005-2008-et-2012","status":"publish","type":"post","link":"https:\/\/www.asafety.fr\/en\/cryptologie\/dechiffrement-dobjets-mssql-2000-2005-2008-et-2012\/","title":{"rendered":"D\u00e9chiffrement d&#8217;objets MSSQL 2000, 2005, 2008 et 2012"},"content":{"rendered":"<p><\/p>\n<p style=\"text-align: justify;\">Les serveurs SQL de Microsoft connus sous le nom MSSQL ont la facult\u00e9 depuis la version 6.5 (puis 7, \u00a02000, 2005, 2008 et enfin 2012) de prot\u00e9ger les objets via un algorithme de chiffrement.<\/p>\n<p style=\"text-align: justify;\">Les serveurs MSSQL autorisent le chiffrement sur :<\/p>\n<ul style=\"text-align: justify;\">\n<li>Les vues (<em>view<\/em>\u00a0&#8211; v)<\/li>\n<li>Les fonctions (<em>function<\/em>\u00a0&#8211; fct)<\/li>\n<li>Les proc\u00e9dures stock\u00e9es (<em>stored procedure<\/em>\u00a0&#8211; sp)<\/li>\n<li>Les d\u00e9clencheurs (<em>trigger<\/em>)<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">Cette protection se caract\u00e9rise par un petit cadenas appos\u00e9 sur ces dits objets au travers du client &#8220;Microsoft SQL Server Management Studio&#8221; (SSMS). Leur \u00e9dition devient impossible, tout comme la visualisation du code source de ces objets.<\/p>\n<div id=\"attachment_528\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/1-procedure_stored_encrypted.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-528\" class=\"size-medium wp-image-528  \" alt=\"Objet chiffr\u00e9 dans MSSQL2012 visible via SSMS\" src=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/1-procedure_stored_encrypted-300x206.png\" width=\"300\" height=\"206\" srcset=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/1-procedure_stored_encrypted-300x206.png 300w, https:\/\/www.asafety.fr\/wp-content\/uploads\/1-procedure_stored_encrypted.png 915w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-528\" class=\"wp-caption-text\">Objet chiffr\u00e9 dans MSSQL2012 visible via SSMS<\/p><\/div>\n<p style=\"text-align: justify;\">Ces objets chiffr\u00e9s ne peuvent \u00eatre \u00e9dit\u00e9s, modifi\u00e9s, ou visualis\u00e9s :<\/p>\n<div id=\"attachment_529\" style=\"width: 305px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/2-procedure_stored_encrypted-non-edit.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-529\" class=\"size-medium wp-image-529  \" alt=\"Edition restreinte de l'objet chiffr\u00e9\" src=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/2-procedure_stored_encrypted-non-edit-295x300.png\" width=\"295\" height=\"300\" srcset=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/2-procedure_stored_encrypted-non-edit-295x300.png 295w, https:\/\/www.asafety.fr\/wp-content\/uploads\/2-procedure_stored_encrypted-non-edit.png 361w\" sizes=\"auto, (max-width: 295px) 100vw, 295px\" \/><\/a><p id=\"caption-attachment-529\" class=\"wp-caption-text\">Edition restreinte de l&#8217;objet chiffr\u00e9<\/p><\/div>\n<p style=\"text-align: justify;\">Ces m\u00e9canismes sont largement employ\u00e9s par de nombreux \u00e9diteurs et d\u00e9veloppeurs de produits logiciels bas\u00e9s sur MSSQL, afin de prot\u00e9ger la propri\u00e9t\u00e9 intellectuelle et le droit d&#8217;auteur de leurs scripts. Toutefois, l&#8217;algorithme en place dans chacune des versions de MSSQL Server s&#8217;av\u00e8re faible et peut \u00eatre facilement invers\u00e9.<\/p>\n<h3 style=\"text-align: justify;\">Comment d\u00e9finir un objet chiffr\u00e9 au sein d&#8217;une base MSSQL ?<\/h3>\n<p style=\"text-align: justify;\">La m\u00e9thode pour prot\u00e9ger ces objets est d&#8217;une grande simplicit\u00e9. Il suffit de d\u00e9clarer chacun d&#8217;eux en utilisant les mots cl\u00e9s &#8220;WITH ENCRYPTION&#8221;. Exemple pour une proc\u00e9dure simple :<\/p>\n<p>[sql]&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;CREATE PROCEDURE helloWorld&amp;lt;br \/&amp;gt;<br \/>\nWITH ENCRYPTION&amp;lt;br \/&amp;gt;<br \/>\nAS&amp;lt;br \/&amp;gt;<br \/>\n PRINT &#8216;Encrypted procedure !&#8217;&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;[\/sql]<\/p>\n<p style=\"text-align: justify;\">D\u00e8s que ces mots cl\u00e9s sont renseign\u00e9s, la proc\u00e9dure, fonction, trigger ou vue est prot\u00e9g\u00e9e de l&#8217;\u00e9dition et de la consultation. Il convient donc de toujours conserver une version en clair de l&#8217;objet, pour pouvoir le mettre \u00e0 jour ais\u00e9ment.<\/p>\n<h3 style=\"text-align: justify;\">\u00c9tat de l&#8217;Art du d\u00e9chiffrement MSSQL toutes versions<\/h3>\n<p style=\"text-align: justify;\">Depuis de nombreuse ann\u00e9es, de multiples outils permettent de d\u00e9chiffrer les objets des base MSSQL. La plupart sont payants, et dispose d&#8217;une version d&#8217;essai qui limite le d\u00e9chiffrement \u00e0 N caract\u00e8res. De plus, certains ne prennent pas en compte toutes les versions de MSSQL, encore moins la derni\u00e8re MSSQL 2012.<\/p>\n<p style=\"text-align: justify;\">Liste non-exhaustive de solutions existantes :<\/p>\n<ul style=\"text-align: justify;\">\n<li><a title=\"DecryptSQL\" href=\"http:\/\/www.devlib.net\/decryptsql.htm\" target=\"_blank\">DecryptSQL<\/a> (MSSQL2000 \u00e0 2008, <em>shareware<\/em>)<\/li>\n<li><a title=\"SQL Script Recovery Pro 1.50\" href=\"http:\/\/www.ussun.com\/decryptor\/\" target=\"_blank\">SQL Script Recovery Pro 1.50<\/a> (MSSQL 7 \u00e0 2000)<\/li>\n<li><a title=\"SQL Object Decrypt\" href=\"http:\/\/shareit1.element5.com\/product.html?productid=163349&amp;languageid=1&amp;layout=SHI&amp;crawler=1\" target=\"_blank\">SQL Object Decrypt<\/a> (MSSQL 7 \u00e0 2005, EXPRESS \u00e9dition comprise)<\/li>\n<li><a title=\"SQLShield\" href=\"http:\/\/www.sql-shield.com\/en\/support\/decrypt-stored-procedure\" target=\"_blank\">SQLShield<\/a>, qui fourni diverses solutions pour diff\u00e9rentes versions jusqu&#8217;\u00e0 2008.<\/li>\n<li><a title=\"Orbital SQL Decryptor\" href=\"http:\/\/orbitals-sql-decryptor.lastdownload.com\/\" target=\"_blank\">Orbital SQL Decryptor<\/a> (MSSQL 6.5 \u00e0 2000)<\/li>\n<li><a title=\"dbForge SQL Decryptor\" href=\"http:\/\/www.devart.com\/\" target=\"_blank\">dbForge SQL Decryptor<\/a><\/li>\n<li><a title=\"Optillect SQL Decryptor\" href=\"http:\/\/download.cnet.com\/Optillect-SQL-Decryptor\/3000-10254_4-75300271.html\" target=\"_blank\">Optillect SQL Decryptor<\/a> (MSSQL 2000 \u00e0 2008, <em>freeware<\/em>)<\/li>\n<\/ul>\n<h3 style=\"text-align: justify;\">D\u00e9chiffrement d&#8217;objets MSSQL 2000, 2005 et 2008 via Optillect SQL Decryptor<\/h3>\n<p style=\"text-align: justify;\">Au sein de cette jungle d&#8217;outil, il y en a un qui sort du lot pour sa simplicit\u00e9 d&#8217;exploitation, d&#8217;utilisation et ses fonctionnalit\u00e9s. Un autre avantage est qu&#8217;il est totalement gratuit. Cet outil est &#8220;<a href=\"https:\/\/www.asafety.fr\/cryptologie\/dechiffrement-dobjets-mssql-2000-2005-2008-et-2012\/attachment\/optillect-sqldecryptor_v2-0-0-freeware\/\" rel=\"attachment wp-att-534\">Optillect SqlDecryptor_v2.0.0 &#8211; freeware<\/a>&#8221; (de 2011). Il assure le d\u00e9chiffrement d&#8217;objet de toutes les versions des bases MSSQL sauf de la derni\u00e8re en date : la 2012 (sortie en avril de la m\u00eame ann\u00e9e). L&#8217;\u00e9diteur de ce programme ne semble plus actif et aucune mise \u00e0 jour n&#8217;a l&#8217;air pr\u00e9vu.<\/p>\n<p style=\"text-align: justify;\">Apr\u00e8s son installation, il suffit de lancer l&#8217;outil, renseigner le serveur MSSQL auquel se connecter ainsi que les cr\u00e9dentiels associ\u00e9s et la liste des objets devient visible (un MSSQL 2008 est exploit\u00e9 dans cet exemple) :<\/p>\n<div id=\"attachment_535\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/3-optillect-credentials.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-535\" class=\"size-medium wp-image-535 \" alt=\"Connexion via Optillect SQL Decryptor\" src=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/3-optillect-credentials-300x217.png\" width=\"300\" height=\"217\" srcset=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/3-optillect-credentials-300x217.png 300w, https:\/\/www.asafety.fr\/wp-content\/uploads\/3-optillect-credentials.png 414w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-535\" class=\"wp-caption-text\">Connexion via Optillect SQL Decryptor<\/p><\/div>\n<p style=\"text-align: justify;\">Il suffit par la suite de choisir l&#8217;entit\u00e9 \u00e0 d\u00e9chiffrer. Un double-clic permet de visualiser directement le code en clair (avec les commentaires) de l&#8217;objet. Un clic droit permet d&#8217;acc\u00e9der aux diverses fonctionnalit\u00e9s sur l&#8217;entit\u00e9, comme son remplacement direct dans la base de donn\u00e9es.<\/p>\n<div id=\"attachment_536\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/4-optillect-decrypted.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-536\" class=\"size-medium wp-image-536 \" alt=\"D\u00e9chiffrement d'un objet via Optillect SQL Decryptor\" src=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/4-optillect-decrypted-300x204.png\" width=\"300\" height=\"204\" srcset=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/4-optillect-decrypted-300x204.png 300w, https:\/\/www.asafety.fr\/wp-content\/uploads\/4-optillect-decrypted.png 638w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-536\" class=\"wp-caption-text\">D\u00e9chiffrement d&#8217;un objet via Optillect SQL Decryptor<\/p><\/div>\n<h3 style=\"text-align: justify;\">D\u00e9chiffrement d&#8217;objets MSSQL 2000, 2005, 2008 et 2012 via une proc\u00e9dure stock\u00e9e<\/h3>\n<p style=\"text-align: justify;\">Lorsque les outils disponibles ne permettent pas de d\u00e9chiffrer des objets d&#8217;une version r\u00e9cente (MSSQL Server 2012 notamment), il est possible de d\u00e9finir une proc\u00e9dure manuellement dans la base \u00e0 ces fins. Cette proc\u00e9dure impl\u00e9mente l&#8217;algorithme de d\u00e9chiffrement complet.<\/p>\n<p style=\"text-align: justify;\">Microsoft a fait \u00e9voluer la structure et le sch\u00e9ma de ses tables syst\u00e8mes entre les versions 2000 (et ant\u00e9rieur) et les versions sup\u00e9rieures \u00e0 2000. Toutefois, entre les versions 2005, 2008 et 2012, l&#8217;algorithme et la structure des tables n&#8217;a pas \u00e9volu\u00e9. Autrement dit, il est possible de d\u00e9chiffrer n&#8217;importe quel objet via une proc\u00e9dure stock\u00e9e SQL sp\u00e9cifique, quelque soit la version de MSSQL.<\/p>\n<p style=\"text-align: justify;\">Cette proc\u00e9dure pour MSSQL 2005, 2008 et 2012 est la suivante :<\/p>\n<p>[sql]&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;\/*==================================================================================&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;NAME: Decrypt SQL 2005, 2008 and 2012 stored procedures, functions, views, and triggers&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;DESCRIPTION: HEADS UP: In order to run this script you must log in&amp;lt;br \/&amp;gt;<br \/>\n to the server in DAC mode: To do so, type&amp;lt;br \/&amp;gt;<br \/>\n ADMIN:&amp;amp;amp;lt;SQLInstanceName&amp;amp;amp;gt; as your server name and use the &amp;amp;amp;quot;sa&amp;amp;amp;quot;&amp;lt;br \/&amp;gt;<br \/>\n or any other server admin user with the appropriate password.&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt; CAUTION! DAC (dedicated admin access) will kick out all other&amp;lt;br \/&amp;gt;<br \/>\n server users.&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt; The script below accepts an object (schema name + object name)&amp;lt;br \/&amp;gt;<br \/>\n that were created using the WITH ENCRYPTION option and returns&amp;lt;br \/&amp;gt;<br \/>\n the decrypted script that creates the object. This script&amp;lt;br \/&amp;gt;<br \/>\n is useful to decrypt stored procedures, views, functions,&amp;lt;br \/&amp;gt;<br \/>\n and triggers that were created WITH ENCRYPTION.&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt; The algorithm used below is the following:&amp;lt;br \/&amp;gt;<br \/>\n 1. Check that the object exists and that it is encrypted.&amp;lt;br \/&amp;gt;<br \/>\n 2. In order to decrypt the object, the script ALTER (!!!) it&amp;lt;br \/&amp;gt;<br \/>\n and later restores the object to its original one. This is&amp;lt;br \/&amp;gt;<br \/>\n required as part of the decryption process: The object&amp;lt;br \/&amp;gt;<br \/>\n is altered to contain dummy text (the ALTER uses WITH ENCRYPTION)&amp;lt;br \/&amp;gt;<br \/>\n and then compared to the CREATE statement of the same dummy&amp;lt;br \/&amp;gt;<br \/>\n content.&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt; Note: The object is altered in a transaction, which is rolled&amp;lt;br \/&amp;gt;<br \/>\n back immediately after the object is changed to restore&amp;lt;br \/&amp;gt;<br \/>\n all previous settings.&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt; 3. A XOR operation between the original binary stream of the&amp;lt;br \/&amp;gt;<br \/>\n enrypted object with the binary representation of the dummy&amp;lt;br \/&amp;gt;<br \/>\n object and the binary version of the object in clear-text&amp;lt;br \/&amp;gt;<br \/>\n is used to decrypt the original object.&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;USER PARAMETERS: @ObjectOwnerOrSchema&amp;lt;br \/&amp;gt;<br \/>\n @ObjectName&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;RESULTSET: NA&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;RESULTSET SORT: NA&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;USING TABLES\/VIEWS: sys.sysobjvalues&amp;lt;br \/&amp;gt;<br \/>\n syscomments&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;REVISIONS&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;DATE DEVELOPER DESCRIPTION OF REVISION VERSION&amp;lt;br \/&amp;gt;<br \/>\n========= =============== ================================= ===========&amp;lt;br \/&amp;gt;<br \/>\n01\/01\/2007 Omri Bahat Initial release 1.00&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;01\/18\/2013 Yann CAM Test script on MSSQL 2008 and 2012&amp;lt;br \/&amp;gt;<br \/>\n==================================================================================*\/&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;DECLARE @ObjectOwnerOrSchema NVARCHAR(128)&amp;lt;br \/&amp;gt;<br \/>\nDECLARE @ObjectName NVARCHAR(128)&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;SET @ObjectOwnerOrSchema = &#8216;dbo&#8217;&amp;lt;br \/&amp;gt;<br \/>\nSET @ObjectName = &#8216;helloWorld&#8217;&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;DECLARE @i INT&amp;lt;br \/&amp;gt;<br \/>\nDECLARE @ObjectDataLength INT&amp;lt;br \/&amp;gt;<br \/>\nDECLARE @ContentOfEncryptedObject NVARCHAR(MAX)&amp;lt;br \/&amp;gt;<br \/>\nDECLARE @ContentOfDecryptedObject NVARCHAR(MAX)&amp;lt;br \/&amp;gt;<br \/>\nDECLARE @ContentOfFakeObject NVARCHAR(MAX)&amp;lt;br \/&amp;gt;<br \/>\nDECLARE @ContentOfFakeEncryptedObject NVARCHAR(MAX)&amp;lt;br \/&amp;gt;<br \/>\nDECLARE @ObjectType NVARCHAR(128)&amp;lt;br \/&amp;gt;<br \/>\nDECLARE @ObjectID INT&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;SET NOCOUNT ON&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;SET @ObjectID = OBJECT_ID(&#8216;[&#8216; + @ObjectOwnerOrSchema + &#8216;].[&#8216; + @ObjectName + &#8216;]&#8217;)&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;&#8211; Check that the provided object exists in the database.&amp;lt;br \/&amp;gt;<br \/>\nIF @ObjectID IS NULL&amp;lt;br \/&amp;gt;<br \/>\nBEGIN&amp;lt;br \/&amp;gt;<br \/>\n RAISERROR(&#8216;The object name or schema provided does not exist in the database&#8217;, 16, 1)&amp;lt;br \/&amp;gt;<br \/>\n RETURN&amp;lt;br \/&amp;gt;<br \/>\nEND&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;&#8211; Check that the provided object is encrypted.&amp;lt;br \/&amp;gt;<br \/>\nIF NOT EXISTS(SELECT TOP 1 * FROM syscomments WHERE id = @ObjectID AND encrypted = 1)&amp;lt;br \/&amp;gt;<br \/>\nBEGIN&amp;lt;br \/&amp;gt;<br \/>\n RAISERROR(&#8216;The object provided exists however it is not encrypted. Aborting.&#8217;, 16, 1)&amp;lt;br \/&amp;gt;<br \/>\n RETURN&amp;lt;br \/&amp;gt;<br \/>\nEND&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;&#8211; Determine the type of the object&amp;lt;br \/&amp;gt;<br \/>\nIF OBJECT_ID(&#8216;[&#8216; + @ObjectOwnerOrSchema + &#8216;].[&#8216; + @ObjectName + &#8216;]&#8217;, &#8216;PROCEDURE&#8217;) IS NOT NULL&amp;lt;br \/&amp;gt;<br \/>\n SET @ObjectType = &#8216;PROCEDURE&#8217;&amp;lt;br \/&amp;gt;<br \/>\nELSE&amp;lt;br \/&amp;gt;<br \/>\n IF OBJECT_ID(&#8216;[&#8216; + @ObjectOwnerOrSchema + &#8216;].[&#8216; + @ObjectName + &#8216;]&#8217;, &#8216;TRIGGER&#8217;) IS NOT NULL&amp;lt;br \/&amp;gt;<br \/>\n SET @ObjectType = &#8216;TRIGGER&#8217;&amp;lt;br \/&amp;gt;<br \/>\n ELSE&amp;lt;br \/&amp;gt;<br \/>\n IF OBJECT_ID(&#8216;[&#8216; + @ObjectOwnerOrSchema + &#8216;].[&#8216; + @ObjectName + &#8216;]&#8217;, &#8216;VIEW&#8217;) IS NOT NULL&amp;lt;br \/&amp;gt;<br \/>\n SET @ObjectType = &#8216;VIEW&#8217;&amp;lt;br \/&amp;gt;<br \/>\n ELSE&amp;lt;br \/&amp;gt;<br \/>\n SET @ObjectType = &#8216;FUNCTION&#8217;&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;&#8211; Get the binary representation of the object- syscomments no longer holds&amp;lt;br \/&amp;gt;<br \/>\n&#8212; the content of encrypted object.&amp;lt;br \/&amp;gt;<br \/>\nSELECT TOP 1 @ContentOfEncryptedObject = imageval&amp;lt;br \/&amp;gt;<br \/>\nFROM sys.sysobjvalues&amp;lt;br \/&amp;gt;<br \/>\nWHERE objid = OBJECT_ID(&#8216;[&#8216; + @ObjectOwnerOrSchema + &#8216;].[&#8216; + @ObjectName + &#8216;]&#8217;)&amp;lt;br \/&amp;gt;<br \/>\n AND valclass = 1 and subobjid = 1&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;SET @ObjectDataLength = DATALENGTH(@ContentOfEncryptedObject)\/2&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;&#8211; We need to alter the existing object and make it into a dummy object&amp;lt;br \/&amp;gt;<br \/>\n&#8212; in order to decrypt its content. This is done in a transaction&amp;lt;br \/&amp;gt;<br \/>\n&#8212; (which is later rolled back) to ensure that all changes have a minimal&amp;lt;br \/&amp;gt;<br \/>\n&#8212; impact on the database.&amp;lt;br \/&amp;gt;<br \/>\nSET @ContentOfFakeObject = N&#8217;ALTER &#8216; + @ObjectType + N&#8217; [&#8216; + @ObjectOwnerOrSchema + N&#8217;].[&#8216; + @ObjectName + N&#8217;] WITH ENCRYPTION AS&#8217;&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;WHILE DATALENGTH(@ContentOfFakeObject)\/2 &amp;amp;amp;lt; @ObjectDataLength&amp;lt;br \/&amp;gt;<br \/>\nBEGIN&amp;lt;br \/&amp;gt;<br \/>\n IF DATALENGTH(@ContentOfFakeObject)\/2 + 4000 &amp;amp;amp;lt; @ObjectDataLength&amp;lt;br \/&amp;gt;<br \/>\n SET @ContentOfFakeObject = @ContentOfFakeObject + REPLICATE(N&#8217;-&#8216;, 4000)&amp;lt;br \/&amp;gt;<br \/>\n ELSE&amp;lt;br \/&amp;gt;<br \/>\n SET @ContentOfFakeObject = @ContentOfFakeObject + REPLICATE(N&#8217;-&#8216;, @ObjectDataLength &#8211; (DATALENGTH(@ContentOfFakeObject)\/2))&amp;lt;br \/&amp;gt;<br \/>\nEND&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;&#8211; Since we need to alter the object in order to decrypt it, this is done&amp;lt;br \/&amp;gt;<br \/>\n&#8212; in a transaction&amp;lt;br \/&amp;gt;<br \/>\nSET XACT_ABORT OFF&amp;lt;br \/&amp;gt;<br \/>\nBEGIN TRAN&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;EXEC(@ContentOfFakeObject)&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;IF @@ERROR &amp;amp;amp;lt;&amp;amp;amp;gt; 0&amp;lt;br \/&amp;gt;<br \/>\n ROLLBACK TRAN&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;&#8211; Get the encrypted content of the new &amp;amp;amp;quot;fake&amp;amp;amp;quot; object.&amp;lt;br \/&amp;gt;<br \/>\nSELECT TOP 1 @ContentOfFakeEncryptedObject = imageval&amp;lt;br \/&amp;gt;<br \/>\nFROM sys.sysobjvalues&amp;lt;br \/&amp;gt;<br \/>\nWHERE objid = OBJECT_ID(&#8216;[&#8216; + @ObjectOwnerOrSchema + &#8216;].[&#8216; + @ObjectName + &#8216;]&#8217;)&amp;lt;br \/&amp;gt;<br \/>\n AND valclass = 1 and subobjid = 1&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;IF @@TRANCOUNT &amp;amp;amp;gt; 0&amp;lt;br \/&amp;gt;<br \/>\n ROLLBACK TRAN&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;&#8211; Generate a CREATE script for the dummy object text.&amp;lt;br \/&amp;gt;<br \/>\nSET @ContentOfFakeObject = N&#8217;CREATE &#8216; + @ObjectType + N&#8217; [&#8216; + @ObjectOwnerOrSchema + N&#8217;].[&#8216; + @ObjectName + N&#8217;] WITH ENCRYPTION AS&#8217;&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;WHILE DATALENGTH(@ContentOfFakeObject)\/2 &amp;amp;amp;lt; @ObjectDataLength&amp;lt;br \/&amp;gt;<br \/>\nBEGIN&amp;lt;br \/&amp;gt;<br \/>\n IF DATALENGTH(@ContentOfFakeObject)\/2 + 4000 &amp;amp;amp;lt; @ObjectDataLength&amp;lt;br \/&amp;gt;<br \/>\n SET @ContentOfFakeObject = @ContentOfFakeObject + REPLICATE(N&#8217;-&#8216;, 4000)&amp;lt;br \/&amp;gt;<br \/>\n ELSE&amp;lt;br \/&amp;gt;<br \/>\n SET @ContentOfFakeObject = @ContentOfFakeObject + REPLICATE(N&#8217;-&#8216;, @ObjectDataLength &#8211; (DATALENGTH(@ContentOfFakeObject)\/2))&amp;lt;br \/&amp;gt;<br \/>\nEND&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;SET @i = 1&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;&#8211;Fill the variable that holds the decrypted data with a filler character&amp;lt;br \/&amp;gt;<br \/>\nSET @ContentOfDecryptedObject = N&#8221;&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;WHILE DATALENGTH(@ContentOfDecryptedObject)\/2 &amp;amp;amp;lt; @ObjectDataLength&amp;lt;br \/&amp;gt;<br \/>\nBEGIN&amp;lt;br \/&amp;gt;<br \/>\n IF DATALENGTH(@ContentOfDecryptedObject)\/2 + 4000 &amp;amp;amp;lt; @ObjectDataLength&amp;lt;br \/&amp;gt;<br \/>\n SET @ContentOfDecryptedObject = @ContentOfDecryptedObject + REPLICATE(N&#8217;A&#8217;, 4000)&amp;lt;br \/&amp;gt;<br \/>\n ELSE&amp;lt;br \/&amp;gt;<br \/>\n SET @ContentOfDecryptedObject = @ContentOfDecryptedObject + REPLICATE(N&#8217;A&#8217;, @ObjectDataLength &#8211; (DATALENGTH(@ContentOfDecryptedObject)\/2))&amp;lt;br \/&amp;gt;<br \/>\nEND&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;WHILE @i &amp;amp;amp;lt;= @ObjectDataLength&amp;lt;br \/&amp;gt;<br \/>\nBEGIN&amp;lt;br \/&amp;gt;<br \/>\n &#8211;xor real &amp;amp;amp;amp; fake &amp;amp;amp;amp; fake encrypted&amp;lt;br \/&amp;gt;<br \/>\n SET @ContentOfDecryptedObject = STUFF(@ContentOfDecryptedObject, @i, 1,&amp;lt;br \/&amp;gt;<br \/>\n NCHAR(&amp;lt;br \/&amp;gt;<br \/>\n UNICODE(SUBSTRING(@ContentOfEncryptedObject, @i, 1)) ^&amp;lt;br \/&amp;gt;<br \/>\n (&amp;lt;br \/&amp;gt;<br \/>\n UNICODE(SUBSTRING(@ContentOfFakeObject, @i, 1)) ^&amp;lt;br \/&amp;gt;<br \/>\n UNICODE(SUBSTRING(@ContentOfFakeEncryptedObject, @i, 1))&amp;lt;br \/&amp;gt;<br \/>\n )))&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;SET @i = @i + 1&amp;lt;br \/&amp;gt;<br \/>\nEND&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;&#8211; PRINT the content of the decrypted object in chunks of 2K characters&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;SET @i = 0&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;WHILE DATALENGTH(@ContentOfDecryptedObject)\/2 &amp;amp;amp;gt; (@i + 1)*2000&amp;lt;br \/&amp;gt;<br \/>\nBEGIN&amp;lt;br \/&amp;gt;<br \/>\n PRINT(SUBSTRING(@ContentOfDecryptedObject, 1 + 2000*@i, 2000*(@i + 1)))&amp;lt;br \/&amp;gt;<br \/>\n SET @i = @i + 1&amp;lt;br \/&amp;gt;<br \/>\nEND&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;&#8211; Now print the last chunk, or the only chunk&amp;lt;br \/&amp;gt;<br \/>\n&#8212; (if @ContentOfDecryptedObject does not exceed 2K characters)&amp;lt;br \/&amp;gt;<br \/>\nPRINT(SUBSTRING(@ContentOfDecryptedObject, 1 + 2000*@i, 2000*(@i + 1)))&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;[\/sql]<\/p>\n<p style=\"text-align: justify;\">Cette proc\u00e9dure, d\u00e9velopp\u00e9e par Omri Bahat et publi\u00e9e le 01\/01\/2007 est toujours fonctionnelle pour les derni\u00e8res versions de Microsoft SQL Server (2005, 2008 et 2012).<\/p>\n<p style=\"text-align: justify;\">Il est n\u00e9cessaire de se connecter sous un compte d&#8217;administration au client SSMS pour ex\u00e9cuter cette proc\u00e9dure, via une connexion DAC (<em>Dedicated Administrator Connection<\/em>). Une telle connexion est possible bien que d&#8217;autres connexions soient d\u00e9j\u00e0 \u00e9tablies. Seule une connexion DAC est possible \u00e0 la fois. Par d\u00e9faut, les connexions DAC sont autoris\u00e9es qu&#8217;en local ; pour les activer \u00e0 distance, ex\u00e9cuter les commandes suivantes dans un terminal &#8220;en tant qu&#8217;administrateur&#8221; sur la machine accueillant le serveur SQL :<\/p>\n<p>[bash]&amp;lt;br \/&amp;gt;<br \/>\nsqlcmd&amp;lt;br \/&amp;gt;<br \/>\nsp_configure &#8216;remote admin connections&#8217;, 1;&amp;lt;br \/&amp;gt;<br \/>\nGO&amp;lt;br \/&amp;gt;<br \/>\nRECONFIGURE;&amp;lt;br \/&amp;gt;<br \/>\nGO&amp;lt;br \/&amp;gt;<br \/>\n[\/bash]<\/p>\n<div id=\"attachment_538\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/5-enable-remote-DAC.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-538\" class=\"size-medium wp-image-538 \" alt=\"Activation de l'acc\u00e8s DAC distant\" src=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/5-enable-remote-DAC-300x150.png\" width=\"300\" height=\"150\" srcset=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/5-enable-remote-DAC-300x150.png 300w, https:\/\/www.asafety.fr\/wp-content\/uploads\/5-enable-remote-DAC.png 678w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-538\" class=\"wp-caption-text\">Activation de l&#8217;acc\u00e8s DAC distant<\/p><\/div>\n<p style=\"text-align: justify;\">Pour ouvrir une connexion via le client SSMS en tant qu&#8217;administrateur DAC, faire &#8220;File &gt; New &gt; Database Engine Query&#8221;. Renseigner les cr\u00e9dentiels n\u00e9cessaires \u00e0 la connexion tout en pr\u00e9fixant le &#8220;Server name&#8221; de &#8220;admin:&#8221; (la casse n&#8217;a pas d&#8217;importance) :<\/p>\n<div id=\"attachment_539\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/7-credentiels-DAC.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-539\" class=\"size-medium wp-image-539 \" alt=\"Pr\u00e9fixer le &quot;Server name&quot; de &quot;admin:&quot; pour une connexion DAC\" src=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/7-credentiels-DAC-300x225.png\" width=\"300\" height=\"225\" srcset=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/7-credentiels-DAC-300x225.png 300w, https:\/\/www.asafety.fr\/wp-content\/uploads\/7-credentiels-DAC.png 427w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-539\" class=\"wp-caption-text\">Pr\u00e9fixer le &#8220;Server name&#8221; de &#8220;admin:&#8221; pour une connexion DAC<\/p><\/div>\n<p style=\"text-align: justify;\">Un nouvel onglet d&#8217;ex\u00e9cution de requ\u00eate\u00a0appara\u00eet. Celui-ci dispose des privil\u00e8ges d&#8217;administration DAC. Copier\/coller la proc\u00e9dure de d\u00e9chiffrement d&#8217;objet MSSQL pr\u00e9c\u00e9dente, et modifier en amont de cette proc\u00e9dure le nom de l&#8217;objet \u00e0 d\u00e9chiffrer (fonction, proc\u00e9dure, trigger ou vue). Enfin, cliquer sur &#8220;Execute&#8221; et le code en clair de l&#8217;objet\u00a0appara\u00eet\u00a0en tant que r\u00e9sultat :<\/p>\n<div id=\"attachment_540\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/8-Decrypt-stored-procedure.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-540\" class=\"size-medium wp-image-540 \" alt=\"D\u00e9chiffrement d'objet MSSQL Server 2012 via une proc\u00e9dure stock\u00e9e\" src=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/8-Decrypt-stored-procedure-300x226.png\" width=\"300\" height=\"226\" srcset=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/8-Decrypt-stored-procedure-300x226.png 300w, https:\/\/www.asafety.fr\/wp-content\/uploads\/8-Decrypt-stored-procedure.png 881w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-540\" class=\"wp-caption-text\">D\u00e9chiffrement d&#8217;objet MSSQL Server 2012 via une proc\u00e9dure stock\u00e9e<\/p><\/div>\n<p style=\"text-align: justify;\">L&#8217;objet d\u00e9chiffr\u00e9 contient toujours les mots cl\u00e9s &#8220;WITH ENCRYPTION&#8221;. Il suffit de supprimer ces mots cl\u00e9 et\u00a0de r\u00e9-ex\u00e9cuter\u00a0le code d&#8217;alt\u00e9ration (ALTER) de l&#8217;objet pour le\u00a0r\u00e9-enregistrer\u00a0en clair dans la base.<\/p>\n<p style=\"text-align: justify;\">L&#8217;archive suivante [<a href=\"https:\/\/www.asafety.fr\/cryptologie\/dechiffrement-dobjets-mssql-2000-2005-2008-et-2012\/attachment\/stored_procedures_to_decrypt_mssql_object_2000-2005-2008-2012\/\" rel=\"attachment wp-att-541\">Stored_procedures_to_decrypt_MSSQL_object_2000-2005-2008-2012<\/a>], issue initialement de l&#8217;<a title=\"Article Omri Bahat\" href=\"http:\/\/sqlmag.com\/content1\/topic\/decrypt-sql-server-objects-95728\/catpath\/encryption2\" target=\"_blank\">article tr\u00e8s complet de Omri Bahat<\/a>, comprend tous les fichiers .SQL des proc\u00e9dures de d\u00e9chiffrement quelque soit la version MSSQL en place.<\/p>\n<h3 style=\"text-align: justify;\">Analyse de l&#8217;algorithme de d\u00e9chiffrement<\/h3>\n<p style=\"text-align: justify;\">Le stockage des diff\u00e9rents objets MSSQL (dans les versions sup\u00e9rieures ou \u00e9gales \u00e0 2005) se fait dans la colonne &#8220;imageval&#8221; de la table &#8220;sys.sysobjvalues&#8221;. Cette table est prot\u00e9g\u00e9e lors d&#8217;une connexion simple via SSMS \u00e0 la base, m\u00eame sous un compte d&#8217;administration. C&#8217;est pourquoi il est n\u00e9cessaire de faire une connexion DAC.<\/p>\n<p style=\"text-align: justify;\">L&#8217;algorithme de chiffrement effectue un simple XOR sur le code SQL de l&#8217;objet \u00e0 prot\u00e9ger avant de le stocker dans cette table.<\/p>\n<p style=\"text-align: justify;\">La technique de d\u00e9chiffrement qui est utilis\u00e9e dans la proc\u00e9dure pr\u00e9c\u00e9dente est la suivante :<\/p>\n<ol style=\"text-align: justify;\">\n<li>R\u00e9cup\u00e9ration des donn\u00e9es chiffr\u00e9es de d\u00e9finition de l&#8217;objet (\u00e0 partir de son identifiant unique), dans la colonne &#8220;imageval&#8221; de la table &#8220;sys.sysobjvalues&#8221; et stockage de cette valeur dans une variable &#8220;@ContentOfEncryptedObject&#8221;.<\/li>\n<li>Calcul de la taille de l&#8217;objet dans &#8220;@ContentDataLength&#8221; via la fonction &#8220;DATALENGTH(@ContentOfEncryptedObject)\/2&#8221; (stockage en hexad\u00e9cimal, d&#8217;o\u00f9 le \/2).<\/li>\n<li>Cr\u00e9ation d&#8217;une instruction &#8220;ALTER PROCEDURE&#8221; compl\u00e9t\u00e9e par le caract\u00e8re de commentaire MSSQL &#8220;-&#8221; jusqu&#8217;\u00e0 la taille de l&#8217;objet d\u00e9finie pr\u00e9c\u00e9demment. Exemple : &#8220;ALTER PROCEDURE [dbo].[helloWorld] WITH ENCRYPTION AS&#8212;&#8212;&#8212;&#8211;[&#8230;]&#8221;<\/li>\n<li>Ex\u00e9cution de l&#8217;instruction d&#8217;alt\u00e9ration de la proc\u00e9dure. Ceci \u00e0 pour effet de supprimer la proc\u00e9dure effective pr\u00e9c\u00e9dente, que l&#8217;on cherche \u00e0 d\u00e9chiffrer. Cette proc\u00e9dure a \u00e9t\u00e9 sauvegard\u00e9e dans\u00a0&#8220;@ContentOfEncryptedObject&#8221;.<\/li>\n<li>R\u00e9cup\u00e9ration de la nouvelle proc\u00e9dure red\u00e9finie (compl\u00e9t\u00e9e avec des &#8220;-&#8220;) dans la variable &#8220;@ContentOfFakeEncryptedObject&#8221;.<\/li>\n<li>Annulation de la modification de la proc\u00e9dure (RollBack), pour restaurer la version chiffr\u00e9e cibl\u00e9e (toutefois la fausse proc\u00e9dure a \u00e9t\u00e9 stock\u00e9e dans\u00a0&#8220;@ContentOfFakeEncryptedObject&#8221;).<\/li>\n<li>Cr\u00e9ation d&#8217;une instruction &#8220;CREATE PROCEDURE&#8221; compl\u00e9t\u00e9e par le caract\u00e8re de commentaire MSSQL &#8220;-&#8221; jusqu&#8217;\u00e0 la taille de l&#8217;objet\u00a0&#8220;@ContentDataLength&#8221;. Exemple : &#8220;CREATE PROCEDURE [dbo].[helloWorld] WITH ENCRYPTION AS&#8212;&#8212;&#8212;&#8212;&#8212;[&#8230;]&#8221; et stockage de cette instruction dans la variable &#8220;@ContentFakeObject&#8221;<\/li>\n<\/ol>\n<p style=\"text-align: justify;\">Une fois les diff\u00e9rentes variables initialis\u00e9es, l&#8217;algorithme de d\u00e9codage via un &#8220;OU exclusif&#8221; (XOR) peut \u00eatre appliqu\u00e9. Celui-ci est r\u00e9alis\u00e9 caract\u00e8re par caract\u00e8re en fonction de la taille de objet d\u00e9finie (@i = 1 to @ObjectDataLength), entre les donn\u00e9es de la proc\u00e9dure chiffr\u00e9e cible, les donn\u00e9es de la fausse proc\u00e9dure chiffr\u00e9e et les donn\u00e9es de l&#8217;instruction de cr\u00e9ation de la proc\u00e9dure (en clair). Soit :<\/p>\n<p>[sql]&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;NCHAR(&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;UNICODE(SUBSTRING(@ContentOfEncryptedObject, @i, 1)) ^&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;(&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;UNICODE(SUBSTRING(@ContentOfFakeObject, @i, 1)) ^&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;UNICODE(SUBSTRING(@ContentOfFakeEncryptedObject, @i, 1))&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;)&amp;lt;\/p&amp;gt;<br \/>\n&amp;lt;p&amp;gt;)&amp;lt;br \/&amp;gt;<br \/>\n[\/sql]<\/p>\n<p style=\"text-align: justify;\">L&#8217;id\u00e9e est de d\u00e9finir la cl\u00e9 du XOR \u00e0 partir des deux &#8220;fausses&#8221; proc\u00e9dures ; puis d&#8217;utiliser cette cl\u00e9 sur la v\u00e9ritable proc\u00e9dure cible. Le r\u00e9sultat est le code (comment\u00e9) de l&#8217;objet en clair.<\/p>\n<h3 style=\"text-align: justify;\">Renforcement de s\u00e9curit\u00e9<\/h3>\n<p style=\"text-align: justify;\">Pour renforcer les m\u00e9canismes de protection int\u00e9gr\u00e9s \u00e0 MSSQL, diff\u00e9rentes solutions existent. \u00a0On peut citer l&#8217;une d&#8217;entre elle, nomm\u00e9e &#8220;{3S} SQL Smart Security&#8221;.<\/p>\n<p style=\"text-align: justify;\">Cette solution est un <em>add-in<\/em> de &#8220;Microsoft SQL Server Management Studio&#8221; (SSMS) pour les versions 2005, 2008, 2008 R2, 20012 et leurs versions EXPRESS respectives. La version actuelle de ce produit (1.1) ne traite que les proc\u00e9dures stock\u00e9es. L&#8217;\u00e9diteur pr\u00e9voit \u00e0 l&#8217;avenir de l&#8217;\u00e9tendre aux fonctions, d\u00e9clencheurs et aux vues.<\/p>\n<p style=\"text-align: justify;\">L&#8217;id\u00e9e de cette solution est d&#8217;enrichir et de renforcer le m\u00e9canisme intrins\u00e8que \u00e0 MSSQL &#8220;WITH ENCRYPTION&#8221; via de nouveaux m\u00e9canismes cryptographiques. A surveiller pour l&#8217;avenir \ud83d\ude09 !<\/p>\n<p style=\"text-align: justify;\"><strong>Sources &amp; ressources<\/strong> :<\/p>\n<ul style=\"text-align: justify;\">\n<li><a title=\"SQLMag article par Omri Bahat\" href=\"http:\/\/sqlmag.com\/content1\/topic\/decrypt-sql-server-objects-95728\/catpath\/encryption2\" target=\"_blank\">SQLMag article par Omri Bahat<\/a><\/li>\n<li><a title=\"Proc\u00e9dures de Omri Bahat\" href=\"http:\/\/sqlmag.com\/site-files\/sqlmag.com\/files\/archive\/sqlmag.com\/content\/content\/95728\/95728.zip\" target=\"_blank\">Proc\u00e9dures de Omri Bahat<\/a><\/li>\n<li><a title=\"Article de StackOverflow\" href=\"http:\/\/stackoverflow.com\/questions\/7670636\/how-to-decrypt-stored-procedure-in-sql-server-2008\" target=\"_blank\">Article de StackOverflow<\/a><\/li>\n<li><a title=\"Decrypt SQL Server database objects\" href=\"http:\/\/www.mssqltips.com\/sqlservertip\/1046\/decrypting-sql-server-database-objects\/\" target=\"_blank\"><em>Decrypt SQL Server dabatase objects<\/em><\/a> par Greg Robidoux<\/li>\n<li><a title=\"{3S} SQL Smart Security\" href=\"https:\/\/placko.wordpress.com\/2012\/01\/09\/a-simple-hack-of-a-built-in-ms-sql-server-with-encryption-mechanism\/\" target=\"_blank\">{3S} SQL Smart Security<\/a> de Marian Placko<\/li>\n<li><a title=\"{3S} SQL Smart Security Manual\" href=\"http:\/\/www.3sdownload.placko.eu\/documents\/%7B3S%7D%20SQL%20Smart%20Security%20-%20Step%20by%20Step%20MANUAL.pdf\" target=\"_blank\">{3S} SQL Smart Security Manual<\/a>\u00a0de Marian Placko<\/li>\n<\/ul>\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>Les serveurs SQL de Microsoft connus sous le nom MSSQL ont la facult\u00e9 depuis la version 6.5 (puis 7, \u00a02000, [&hellip;]<\/p>\n","protected":false},"author":1337,"featured_media":1161,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[59,232,58,57,56,167],"tags":[242,241,245,234,237,238,239,240,235,236,249,250,248,244,247,246,243],"class_list":["post-525","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-administration-reseaux-et-systemes","category-database-sql","category-cryptanalyse","category-cryptographie","category-cryptologie","category-windows","tag-dechiffrement","tag-decrypt-mssql-2012-objects","tag-function","tag-microsoft-sql-server","tag-mssql-2000","tag-mssql-2005","tag-mssql-2008","tag-mssql-2012","tag-mssql-6-5","tag-mssql-7","tag-optillect","tag-sql-decryptor","tag-ssms","tag-stored-procedure","tag-trigger","tag-view","tag-xor"],"_links":{"self":[{"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/posts\/525","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/users\/1337"}],"replies":[{"embeddable":true,"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/comments?post=525"}],"version-history":[{"count":34,"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/posts\/525\/revisions"}],"predecessor-version":[{"id":1650,"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/posts\/525\/revisions\/1650"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/media\/1161"}],"wp:attachment":[{"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/media?parent=525"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/categories?post=525"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/tags?post=525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}