<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; помощь с шифрованием]]></title>
		<link>http://forum.script-coding.com/viewtopic.php?id=12880</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=12880&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «помощь с шифрованием».]]></description>
		<lastBuildDate>Sun, 06 Aug 2017 10:30:18 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: помощь с шифрованием]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=117889#p117889</link>
			<description><![CDATA[<p>Спасибо всем,все понял.</p>]]></description>
			<author><![CDATA[null@example.com (klim186)]]></author>
			<pubDate>Sun, 06 Aug 2017 10:30:18 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=117889#p117889</guid>
		</item>
		<item>
			<title><![CDATA[Re: помощь с шифрованием]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=117888#p117888</link>
			<description><![CDATA[<p><span style="color: green"><strong>klim186</strong>, поставьте в своих сообщениях заглавные буквы и точки. Ссылку следует оформлять тегом &quot;URL&quot;.</span></p>]]></description>
			<author><![CDATA[null@example.com (ypppu)]]></author>
			<pubDate>Sun, 06 Aug 2017 10:27:17 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=117888#p117888</guid>
		</item>
		<item>
			<title><![CDATA[Re: помощь с шифрованием]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=117887#p117887</link>
			<description><![CDATA[<p>Вы пример запускали?</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sun, 06 Aug 2017 10:26:45 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=117887#p117887</guid>
		</item>
		<item>
			<title><![CDATA[Re: помощь с шифрованием]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=117886#p117886</link>
			<description><![CDATA[<p>Посмотрите внимательнее, там есть первое:<br /></p><div class="codebox"><pre><code>Shifr := Cipher(Text, Key1, Key2, Key3)  ; Шифруем.
Shifr := StrToBASE64(Shifr)
MsgBox, % Shifr</code></pre></div><p>и второе:<br /></p><div class="codebox"><pre><code>Shifr := BASE64ToStr(Shifr)
Text := Cipher(Shifr, Key3, Key2, Key1) ; Дешифруем, ключи в обратном порядке.
MsgBox, % Text</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sun, 06 Aug 2017 10:26:19 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=117886#p117886</guid>
		</item>
		<item>
			<title><![CDATA[Re: помощь с шифрованием]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=117884#p117884</link>
			<description><![CDATA[<p><strong>serzh82saratov</strong><br />я не очень хорошо понимаю в ахк,можете написать как обращаться к функции,вот что делать что бы зашифровать,и что что бы расшифровать</p>]]></description>
			<author><![CDATA[null@example.com (klim186)]]></author>
			<pubDate>Sun, 06 Aug 2017 10:24:39 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=117884#p117884</guid>
		</item>
		<item>
			<title><![CDATA[Re: помощь с шифрованием]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=117883#p117883</link>
			<description><![CDATA[<p>Как вариант можно результат шифрования перевести в BASE64.<br />Функцию взял <a href="http://forum.script-coding.com/viewtopic.php?pid=23646#p23646">здесь</a>. <br />Для ссылок на этом форуме есть тэг.<br /></p><div class="codebox"><pre><code>
Text =
(
Не жалею, не зову, не плачу,
Все пройдет, как с белых яблонь дым.
Увяданья золотом охваченный,
Я не буду больше молодым.

Ты теперь не так уж будешь биться,
Сердце, тронутое холодком,
И страна березового ситца
Не заманит шляться босиком.
)

Key1 = AutoHotkey forever!
Key2 = Хрен поймёшь, что тут написано.
Key3 = 1234567890

Shifr := Cipher(Text, Key1, Key2, Key3)  ; Шифруем.
Shifr := StrToBASE64(Shifr)
MsgBox, % Shifr

Shifr := BASE64ToStr(Shifr)
Text := Cipher(Shifr, Key3, Key2, Key1) ; Дешифруем, ключи в обратном порядке.
MsgBox, % Text



Cipher(Src, Key1, Key2 = 0, Key3 = 0)  ; Два последних ключа необязательны.
{
  Loop, 3
  {
    If not Key%A_Index%
      Break
    StringSplit, Keys, Key%A_Index%  ; Разбиваем фразу на отдельные ключи.
    Dest =
    Loop, Parse, Src  ; Перебор символов текста.
    {
      Index := Mod(A_Index, Keys0) + 1  ; Чтобы Index не вышел за пределы
                                        ; числа символов в ключевой фразе.
      Key := Asc(Keys%Index%)   ; Очередной ключ.
      Code := Asc(A_LoopField)  ; Код очередного символа текста.
      Dest .= Chr(Code = Key ? Code : Code ^ Key) ; Шифруем и добавляем.
    }
    Src := Dest
  }
  Return Dest
}
 
StrToBASE64(Str, NOCRLF=1)  { 
	Crypt := 1 | (NOCRLF ? 0x40000000 : 0)
	Bytes := StrLen(Str) * (A_IsUnicode ? 2 : 1) 
	DllCall(&quot;Crypt32.dll\CryptBinaryToString&quot;, Ptr, &amp;Str, UInt, Bytes, UInt, Crypt, Ptr, 0, UIntP, Chars)
	VarSetCapacity(OutData, Chars * (A_IsUnicode ? 2 : 1))
	DllCall(&quot;Crypt32.dll\CryptBinaryToString&quot;, Ptr, &amp;Str, UInt, Bytes, UInt, Crypt, Str, OutData, UIntP, Chars)
	Return OutData
}

BASE64ToStr(StringBase64)  { 
	DllCall(&quot;Crypt32.dll\CryptStringToBinary&quot;, Ptr, &amp;StringBase64
		, UInt, StrLen(StringBase64), UInt, 1, UInt, 0, UIntP, Bytes, UIntP, 0, UIntP, 0)
	VarSetCapacity(OutData, Bytes) 
	DllCall(&quot;Crypt32.dll\CryptStringToBinary&quot;, Ptr, &amp;StringBase64
		, UInt, StrLen(StringBase64), UInt, 1, Str, OutData, UIntP, Bytes, UIntP, 0, UIntP, 0)
	Return OutData
}
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sun, 06 Aug 2017 10:18:47 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=117883#p117883</guid>
		</item>
		<item>
			<title><![CDATA[помощь с шифрованием]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=117880#p117880</link>
			<description><![CDATA[<p>написал скрипт который шифрует и дешифрует текст (ну вернее нашел его в инете),так вот при шифровании он использует не совсем понятные символы,при отправке которых в вк или игры преобразует их в другие и дешифровать обратно невозможно,пример ѕуУиOЇЁЂЊRљчѓфђѳѲЎRњэѓщё , как сделать шифрвание но с использованием корректных символов.<br />https://pastebin.com/6Zt2yAwL (код)</p>]]></description>
			<author><![CDATA[null@example.com (klim186)]]></author>
			<pubDate>Sun, 06 Aug 2017 10:02:13 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=117880#p117880</guid>
		</item>
	</channel>
</rss>
