<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; помощь с шифрованием]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=12880&amp;type=atom" />
	<updated>2017-08-06T10:30:18Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=12880</id>
		<entry>
			<title type="html"><![CDATA[Re: помощь с шифрованием]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=117889#p117889" />
			<content type="html"><![CDATA[<p>Спасибо всем,все понял.</p>]]></content>
			<author>
				<name><![CDATA[klim186]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=38678</uri>
			</author>
			<updated>2017-08-06T10:30:18Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=117889#p117889</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: помощь с шифрованием]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=117888#p117888" />
			<content type="html"><![CDATA[<p><span style="color: green"><strong>klim186</strong>, поставьте в своих сообщениях заглавные буквы и точки. Ссылку следует оформлять тегом &quot;URL&quot;.</span></p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2017-08-06T10:27:17Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=117888#p117888</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: помощь с шифрованием]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=117887#p117887" />
			<content type="html"><![CDATA[<p>Вы пример запускали?</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2017-08-06T10:26:45Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=117887#p117887</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: помощь с шифрованием]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=117886#p117886" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2017-08-06T10:26:19Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=117886#p117886</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: помощь с шифрованием]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=117884#p117884" />
			<content type="html"><![CDATA[<p><strong>serzh82saratov</strong><br />я не очень хорошо понимаю в ахк,можете написать как обращаться к функции,вот что делать что бы зашифровать,и что что бы расшифровать</p>]]></content>
			<author>
				<name><![CDATA[klim186]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=38678</uri>
			</author>
			<updated>2017-08-06T10:24:39Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=117884#p117884</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: помощь с шифрованием]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=117883#p117883" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2017-08-06T10:18:47Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=117883#p117883</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[помощь с шифрованием]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=117880#p117880" />
			<content type="html"><![CDATA[<p>написал скрипт который шифрует и дешифрует текст (ну вернее нашел его в инете),так вот при шифровании он использует не совсем понятные символы,при отправке которых в вк или игры преобразует их в другие и дешифровать обратно невозможно,пример ѕуУиOЇЁЂЊRљчѓфђѳѲЎRњэѓщё , как сделать шифрвание но с использованием корректных символов.<br />https://pastebin.com/6Zt2yAwL (код)</p>]]></content>
			<author>
				<name><![CDATA[klim186]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=38678</uri>
			</author>
			<updated>2017-08-06T10:02:13Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=117880#p117880</id>
		</entry>
</feed>
