<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>cryptography &#8211; PT ESC</title>
	<atom:link href="https://ptesc.tech/en/tag/cryptography/feed/" rel="self" type="application/rss+xml" />
	<link>https://ptesc.tech/en/</link>
	<description></description>
	<lastBuildDate>Wed, 30 Sep 2026 19:21:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>

<image>
	<url>https://ptesc.tech/wp-content/uploads/2026/09/cropped-cropped-large_icon-32x32.png</url>
	<title>cryptography &#8211; PT ESC</title>
	<link>https://ptesc.tech/en/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Are you using cryptography correctly?</title>
		<link>https://ptesc.tech/en/are-you-using-cryptography-correctly/</link>
		
		<dc:creator><![CDATA[ti_author]]></dc:creator>
		<pubDate>Mon, 10 Mar 2025 15:06:48 +0000</pubDate>
				<category><![CDATA[Threat Intelligence]]></category>
		<category><![CDATA[cryptography]]></category>
		<category><![CDATA[malware]]></category>
		<category><![CDATA[reverse]]></category>
		<category><![CDATA[TI]]></category>
		<category><![CDATA[tips]]></category>
		<guid isPermaLink="false">http://localhost:8080/%d0%b8%d1%81%d0%bf%d0%be%d0%bb%d1%8c%d0%b7%d1%83%d0%b5%d1%82%d0%b5-%d0%bb%d0%b8-%d0%b2%d1%8b-%d0%ba%d1%80%d0%b8%d0%bf%d1%82%d0%be%d0%b3%d1%80%d0%b0%d1%84%d0%b8%d1%8e-%d0%bf%d1%80%d0%b0%d0%b2%d0%b8/</guid>

					<description><![CDATA[Are you using cryptography correctly? 🔓 The Advanced Threat Research Group of the Threat Intelligence department often has to solve interesting tasks in the process of reverse engineering malware. This time was no exception. There is a tech…]]></description>
										<content:encoded><![CDATA[<strong>Are you using cryptography correctly?</strong> <strong>🔓</strong><br />
<br />
The Advanced Threat Research Group of the Threat Intelligence department often has to solve interesting tasks in the process of reverse engineering malware. This time was no exception. There is a technique known as <a href="https://attack.mitre.org/techniques/T1480/001/" rel="noopener" target="_blank">Execution Guardrails: Environmental Keying</a> — it is needed to restrict the execution of malware to a specific target environment only. For example, it is used by the <a href="https://www.ptsecurity.com/ru-ru/research/pt-esc-threat-intelligence/hellhounds-operaciya-lahat/?utm_source=tg_escalator&#038;utm_medium=decoydog&#038;utm_campaign=10_03" rel="noopener" target="_blank">Decoy Dog</a> group in their operations.<br />
<br />
In the sample that came to us for research, this same technique was used: the computer name, which we did not have, was used as the key for the strings employed, and additionally the sample was obfuscated. If the malware was launched on a device other than the one the attacker intended, it crashed — and that is where our research begins. <br />
<br />
☠️ It turned out that the malware &#8220;crashes&#8221; when attempting to call the <code>LoadLibraryA</code> function with a library name passed as non-printable bytes. This set of bytes should represent the name of a library that is decrypted in a loop; at each iteration, a character is taken from the computer name, transformed into an irreversible form using logical operations, and then XORed with the encrypted text and its single-byte constant. <br />
<br />
To recover the intermediate key (which is formed as a result of the logical operations), we resorted to a <a href="https://ru.wikipedia.org/wiki/%D0%90%D1%82%D0%B0%D0%BA%D0%B0_%D0%BD%D0%B0_%D0%BE%D1%81%D0%BD%D0%BE%D0%B2%D0%B5_%D0%BE%D1%82%D0%BA%D1%80%D1%8B%D1%82%D1%8B%D1%85_%D1%82%D0%B5%D0%BA%D1%81%D1%82%D0%BE%D0%B2" rel="noopener" target="_blank">known-plaintext attack</a>. Returning to the <code>LoadLibraryA</code> function: we know that the library name will consist of 13 bytes in <code>ASCII + &#039;\x00&#039;</code> encoding; this way we were able to recover a third of the key, and then, by analogy with other strings, we recovered the remaining part of the key.<br />
<br />
<pre class="wp-block-code"><span><code lang="plaintext" class="hljs language-plaintext language-plaintext">String decryption:
F(sym_comp_name) ^ sym_enc ^ cnst_enc = sym_dec
F(sym_comp_name) — logical operations

Obtaining the intermediate key:
sym_dll_name ^ sym_enc ^ cnst_enc = irr_sym_key
irr_sym_key — intermediate key byte, irreversible
</code></span></pre><br />
<br />
The Advanced Threat Research Group recommends one of the platforms for studying cryptanalysis — <a href="http://cryptohack.org" rel="noopener" target="_blank">cryptohack.org</a>.

<figure class="wp-block-image"><img width="1024" height="1024" src="https://ptesc.tech/wp-content/uploads/2025/03/photo_227@10-03-2025_15-06-48-1024x1024.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2025/03/photo_227@10-03-2025_15-06-48-1024x1024.jpg 1024w, https://ptesc.tech/wp-content/uploads/2025/03/photo_227@10-03-2025_15-06-48-300x300.jpg 300w, https://ptesc.tech/wp-content/uploads/2025/03/photo_227@10-03-2025_15-06-48-150x150.jpg 150w, https://ptesc.tech/wp-content/uploads/2025/03/photo_227@10-03-2025_15-06-48-768x768.jpg 768w, https://ptesc.tech/wp-content/uploads/2025/03/photo_227@10-03-2025_15-06-48.jpg 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>

<br />
<br />
<span class="hashtag">#tips</span> <span class="hashtag">#reverse</span> <span class="hashtag">#malware</span> <span class="hashtag">#cryptography</span> <span class="hashtag">#TI</span><br />
<a href="https://t.me/ptescalator" rel="noopener" target="_blank">@ptescalator</a>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
