<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Passwort encrypten]]></title><description><![CDATA[<p>Hallo,<br />
ich habe eine Passwortabfrage in einem Programm, die nun mit veränderbarem Passwort ersetzt werden soll. Sprich das Passwort muss irgendwo gespeichert werden. Dazu wäre es sinnvoll das Passwort zu verschlüsseln. Gibts da schon eine fertige funktion? Ansonsten dachte ich zieh ich einfach von jedem char 1 ab. Also B-&gt;A etc. natürlich sehr unsicher, aber so geheim ist das auch nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/191753/passwort-encrypten</link><generator>RSS for Node</generator><lastBuildDate>Fri, 09 Oct 2026 12:33:00 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/191753.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 06 Sep 2007 08:31:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Passwort encrypten on Thu, 06 Sep 2007 08:31:28 GMT]]></title><description><![CDATA[<p>Hallo,<br />
ich habe eine Passwortabfrage in einem Programm, die nun mit veränderbarem Passwort ersetzt werden soll. Sprich das Passwort muss irgendwo gespeichert werden. Dazu wäre es sinnvoll das Passwort zu verschlüsseln. Gibts da schon eine fertige funktion? Ansonsten dachte ich zieh ich einfach von jedem char 1 ab. Also B-&gt;A etc. natürlich sehr unsicher, aber so geheim ist das auch nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1359967</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1359967</guid><dc:creator><![CDATA[streetch]]></dc:creator><pubDate>Thu, 06 Sep 2007 08:31:28 GMT</pubDate></item><item><title><![CDATA[Reply to Passwort encrypten on Thu, 06 Sep 2007 08:40:20 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>C++ kennt keine Verschlüsselung, du must dir also entweder selber einen Algorithmus implementieren oder eine passende externe Library benutzen.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1359982</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1359982</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Thu, 06 Sep 2007 08:40:20 GMT</pubDate></item><item><title><![CDATA[Reply to Passwort encrypten on Thu, 06 Sep 2007 08:44:10 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>was Du tust, ist &quot;Rot1&quot; .... und wirklich nicht besonders sicher.<br />
Mein Vorschlag wäre: Nutze eine Hashfunktion (SHA1 oder so), denn eigentlich brauchst Du ja nicht das Passwort selbst abzuspeichern, sondern nur einen passenden &quot;Vergleichswert&quot;.<br />
Dann vergleichst Du im Programm nur:</p>
<pre><code class="language-cpp">string eingabePW;
   cout &lt;&lt; &quot;Bitte geben Sie das Passwort ein:&quot;
   cin &gt;&gt; eingabePW;

   if(SHA1(eingabePW) != liesHashPW()) {
      cout &lt;&lt; &quot;Falsches Passwort !! -&gt; Abbruch\n&quot;;
      return -1;
   }
</code></pre>
<p>Sowas ist schon etwas sicherer, behält aber letztlich die Schwächen, die jede Softwarelösung in einem &quot;offenen Betriebssystem&quot; hat (z.B. mit einem &quot;Patch&quot; kann z.B. einfach die PW-Abfrage übersprungen werden).<br />
Für den &quot;Normalbetrieb&quot; würde mir das aber reichen.</p>
<p>Gruß,</p>
<p>Simon2.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1359985</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1359985</guid><dc:creator><![CDATA[Simon2]]></dc:creator><pubDate>Thu, 06 Sep 2007 08:44:10 GMT</pubDate></item><item><title><![CDATA[Reply to Passwort encrypten on Thu, 06 Sep 2007 09:54:38 GMT]]></title><description><![CDATA[<p>Ich empfehle einen MD5-Hash zu benutzen, siehe <a href="http://fatman98.fa.funpic.de/builder_crypt.php" rel="nofollow">http://fatman98.fa.funpic.de/builder_crypt.php</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1360064</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1360064</guid><dc:creator><![CDATA[F98]]></dc:creator><pubDate>Thu, 06 Sep 2007 09:54:38 GMT</pubDate></item><item><title><![CDATA[Reply to Passwort encrypten on Thu, 06 Sep 2007 10:36:12 GMT]]></title><description><![CDATA[<p>Also ich benutzte eigentlich immer einen SHA512 hash.<br />
Weil für md5 gibts ja schon tabellen, wo viele hashwerte drinnestehen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1360106</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1360106</guid><dc:creator><![CDATA[dfgdfg]]></dc:creator><pubDate>Thu, 06 Sep 2007 10:36:12 GMT</pubDate></item><item><title><![CDATA[Reply to Passwort encrypten on Thu, 06 Sep 2007 13:12:11 GMT]]></title><description><![CDATA[<p>dfgdfg schrieb:</p>
<blockquote>
<p>Also ich benutzte eigentlich immer einen SHA512 hash.</p>
</blockquote>
<p>Code?</p>
<p>dfgdfg schrieb:</p>
<blockquote>
<p>Weil für md5 gibts ja schon tabellen, wo viele hashwerte drinnestehen.</p>
</blockquote>
<p>Link?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1360219</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1360219</guid><dc:creator><![CDATA[F98]]></dc:creator><pubDate>Thu, 06 Sep 2007 13:12:11 GMT</pubDate></item><item><title><![CDATA[Reply to Passwort encrypten on Thu, 06 Sep 2007 13:19:08 GMT]]></title><description><![CDATA[<p>SHA512:<br />
<a href="http://rafb.net/p/vAoJDB19.html" rel="nofollow">http://rafb.net/p/vAoJDB19.html</a></p>
<p>MD5:<br />
<a href="http://us.md5.crysm.net/" rel="nofollow">http://us.md5.crysm.net/</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1360226</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1360226</guid><dc:creator><![CDATA[dgcfgdgd]]></dc:creator><pubDate>Thu, 06 Sep 2007 13:19:08 GMT</pubDate></item><item><title><![CDATA[Reply to Passwort encrypten on Thu, 06 Sep 2007 13:57:52 GMT]]></title><description><![CDATA[<p>also MD5 und ähnliches ist für meinen Fall totaler overkill. Werde wohl die Rot13 function von dem von f98 geposteten link benutzen.<br />
Eine andere Frage die sich mir nun gestellt hat, ist, wo ich denn das Passwort abspeichere. Einfach in eine Ini rein ist ja blöd, selbst wenn verschlüsselt. Andere Möglichkeit wär in die Registry rein...gibt es da evtl ein Pfad für Passwörter?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1360255</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1360255</guid><dc:creator><![CDATA[streetch]]></dc:creator><pubDate>Thu, 06 Sep 2007 13:57:52 GMT</pubDate></item><item><title><![CDATA[Reply to Passwort encrypten on Thu, 06 Sep 2007 14:44:05 GMT]]></title><description><![CDATA[<p>streetch schrieb:</p>
<blockquote>
<p>also MD5 und ähnliches ist für meinen Fall totaler overkill. Werde wohl die Rot13 function von dem von f98 geposteten link benutzen.<br />
Eine andere Frage die sich mir nun gestellt hat, ist, wo ich denn das Passwort abspeichere. Einfach in eine Ini rein ist ja blöd, selbst wenn verschlüsselt. Andere Möglichkeit wär in die Registry rein...gibt es da evtl ein Pfad für Passwörter?</p>
</blockquote>
<p>Deine &quot;andere Frage&quot; belegt, dass Deine erste Einschätzung falsch ist. :p <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /><br />
Ich wette mit Dir, dass Du viel schneller den o.a. Code für die Hashfunktionen eingebunden hast als mit irgendwelchen OS-spezifischen Funktionen &quot;Pseudosicherheit&quot; erzeugt.</p>
<p>Mein Tipp: Nimm die Hashfunktion und schreib den PW-Hash in die IniDatei.<br />
Geht schneller und ist sicherer.</p>
<p>Gruß,</p>
<p>Simon2.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1360298</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1360298</guid><dc:creator><![CDATA[Simon2]]></dc:creator><pubDate>Thu, 06 Sep 2007 14:44:05 GMT</pubDate></item><item><title><![CDATA[Reply to Passwort encrypten on Thu, 06 Sep 2007 15:51:31 GMT]]></title><description><![CDATA[<p>dgcfgdgd schrieb:</p>
<blockquote>
<p>SHA512:<br />
<a href="http://rafb.net/p/vAoJDB19.html" rel="nofollow">http://rafb.net/p/vAoJDB19.html</a></p>
</blockquote>
<p>Danke! Gibts da auch ein Anwendungsbeispiel dafür?</p>
<p>dgcfgdgd schrieb:</p>
<blockquote>
<p>MD5:<br />
<a href="http://us.md5.crysm.net/" rel="nofollow">http://us.md5.crysm.net/</a></p>
</blockquote>
<p>Interessant.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1360337</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1360337</guid><dc:creator><![CDATA[F98]]></dc:creator><pubDate>Thu, 06 Sep 2007 15:51:31 GMT</pubDate></item><item><title><![CDATA[Reply to Passwort encrypten on Thu, 06 Sep 2007 16:12:19 GMT]]></title><description><![CDATA[<p>Anwendugsbeispiel(so benutzte ich's):</p>
<pre><code class="language-cpp">LPCWSTR lpPassword = L&quot;TOTOTOTO&quot;;
BYTE digest[64];
Sha512 sh;
sh.Update((BYTE*)lpPassword, (DWORD)wcslen(lpPassword) * 2 + 2);
sh.Final(digest);
</code></pre>
<p>Und schon hat man den hash wert.<br />
Für die größe vom hash kannst du SHA512_DIGEST_SIZE benutzen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1360353</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1360353</guid><dc:creator><![CDATA[ertert]]></dc:creator><pubDate>Thu, 06 Sep 2007 16:12:19 GMT</pubDate></item><item><title><![CDATA[Reply to Passwort encrypten on Fri, 07 Sep 2007 08:56:55 GMT]]></title><description><![CDATA[<p>ertert schrieb:</p>
<blockquote>
<p>Für die größe vom hash kannst du SHA512_DIGEST_SIZE benutzen.</p>
</blockquote>
<p>Verstehe ich jetzt nicht ganz im Zusammenhang mit dem Anwendungsbeispiel. Und wieso wird die Passwortlänge *2+2 gerechnet?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1360636</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1360636</guid><dc:creator><![CDATA[F98]]></dc:creator><pubDate>Fri, 07 Sep 2007 08:56:55 GMT</pubDate></item><item><title><![CDATA[Reply to Passwort encrypten on Fri, 07 Sep 2007 10:20:10 GMT]]></title><description><![CDATA[<p>Die Update funktion erwartet bytes, wcslen gibt aber die länge in wchar_t zurück.<br />
Und da die 2 groß sind(besser sizeof(wchar_t)) nehme ich die länge des texts mal 2 und addiere noch 2 für den null char am ende.</p>
<p>BYTE diges[SHA512_DIGEST_SIZE];</p>
<p>so kann man auch SHA256_DIGEST_SIZE etc. benutzten, und muss nicht die länge in bytes ausrechnen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1360688</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1360688</guid><dc:creator><![CDATA[rseterter]]></dc:creator><pubDate>Fri, 07 Sep 2007 10:20:10 GMT</pubDate></item><item><title><![CDATA[Reply to Passwort encrypten on Fri, 07 Sep 2007 12:35:21 GMT]]></title><description><![CDATA[<p>Ok, und den Kauderwelsch, der in digest steht muß man dann noch in Hex wandeln?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1360789</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1360789</guid><dc:creator><![CDATA[F98]]></dc:creator><pubDate>Fri, 07 Sep 2007 12:35:21 GMT</pubDate></item><item><title><![CDATA[Reply to Passwort encrypten on Fri, 07 Sep 2007 13:35:10 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">std::string bignum_to_string (bignum const&amp; n)
{
    std::ostringstream os;
    os.width (2);
    os.fill ('0');
    BOOST_FOREACH(unsigned byte, n)
    {
        os &lt;&lt; std::hex &lt;&lt;  byte;
    }
    return os.str ();
}

template &lt;typename Iterator&gt;
unsigned char read_byte (Iterator&amp; i)
{
    unsigned char c = *i++;
    unsigned char result = (c &lt; 'a' ? c - '0' : c - 'a' + 10) * 16;
    c = *i++;
    return result + (c &lt; 'a' ? c - '0' : c - 'a' + 10);
}

bignum string_to_bignum (std::string const&amp; s)
{
     bignum result;
     std::string::const_iterator i = s.begin ();
     BOOST_FOREACH(unsigned char&amp; b, result)
     {
         b = read_byte (i);
     }
     return result;
}
</code></pre>
<p>So mach ich das. bignum ist einfach ein sehr schmal gekapseltes Array (soll heißen es bietet begin und end). BOOST_FOREACH muss man auch nicht benutzen. read_byte geht sicherlich schöner (und portabler), aber für den Anfang tuts das auch ;).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1360827</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1360827</guid><dc:creator><![CDATA[.filmor]]></dc:creator><pubDate>Fri, 07 Sep 2007 13:35:10 GMT</pubDate></item><item><title><![CDATA[Reply to Passwort encrypten on Mon, 24 Sep 2007 11:50:27 GMT]]></title><description><![CDATA[<p>Vielleicht wäre ja auch hashlib++ eine alternative.<br />
Im moment werden zwar nur MD5 und SHA1 unterstützt, aber dafür ist die Sache sehr einfach zu handhaben.</p>
<p><a href="http://hashlib2plus.sourceforge.net" rel="nofollow">http://hashlib2plus.sourceforge.net</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1371556</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1371556</guid><dc:creator><![CDATA[hashlib++]]></dc:creator><pubDate>Mon, 24 Sep 2007 11:50:27 GMT</pubDate></item><item><title><![CDATA[Reply to Passwort encrypten on Mon, 24 Sep 2007 14:51:09 GMT]]></title><description><![CDATA[<p>falls du die volle packung brauchst nimm <a href="http://www.cryptopp.com" rel="nofollow">www.cryptopp.com</a>. einbinden, in deinem fall zwei zeilen code schreiben - fertig.</p>
<p>@md5: gilt immer noch als nicht geknackt. es treten lediglich kollisionen auf. für anwendungen wo es nicht wirklich drauf ankommt immer noch völlig in ordnung. sha etc. sind natürlich sicherer und auch nicht schwieriger zu verwenden,.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1371713</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1371713</guid><dc:creator><![CDATA[xyz123]]></dc:creator><pubDate>Mon, 24 Sep 2007 14:51:09 GMT</pubDate></item><item><title><![CDATA[Reply to Passwort encrypten on Sun, 17 Feb 2008 20:23:39 GMT]]></title><description><![CDATA[<p>ertert schrieb:</p>
<blockquote>
<p>Anwendugsbeispiel(so benutzte ich's):</p>
<pre><code class="language-cpp">LPCWSTR lpPassword = L&quot;TOTOTOTO&quot;;
BYTE digest[64];
Sha512 sh;
sh.Update((BYTE*)lpPassword, (DWORD)wcslen(lpPassword) * 2 + 2);
sh.Final(digest);
</code></pre>
<p>Und schon hat man den hash wert.<br />
Für die größe vom hash kannst du SHA512_DIGEST_SIZE benutzen.</p>
</blockquote>
<p>Kann mir jemand sagen wie ich BYTE in char* oder System::String o.Ä. bekomme?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1457808</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1457808</guid><dc:creator><![CDATA[Cronkk]]></dc:creator><pubDate>Sun, 17 Feb 2008 20:23:39 GMT</pubDate></item><item><title><![CDATA[Reply to Passwort encrypten on Sun, 17 Feb 2008 21:37:50 GMT]]></title><description><![CDATA[<p><code>BYTE</code> <em>ist</em> in der Regel <code>char</code> oder <code>unsigned char</code> .</p>
<p>greetz, Swordfish</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1457845</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1457845</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Sun, 17 Feb 2008 21:37:50 GMT</pubDate></item><item><title><![CDATA[Reply to Passwort encrypten on Sun, 17 Feb 2008 21:45:10 GMT]]></title><description><![CDATA[<p>BYTE ist in der Regel wohl unsigned char (0 ... 255) ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1457851</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1457851</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Sun, 17 Feb 2008 21:45:10 GMT</pubDate></item><item><title><![CDATA[Reply to Passwort encrypten on Sun, 17 Feb 2008 21:48:45 GMT]]></title><description><![CDATA[<p>Ist mir inzeischen auch wieder eingefallen, bringt mich leider nicht weiter:<br />
Wenn ich den Hash von <em>Teststring</em> bilde erhalte ich mit</p>
<pre><code class="language-cpp">char* hashChar = (char*)hash;
</code></pre>
<p>(hash ist ein BYTE Wert) <em>Ïƒá5~ï¸½ñT(PÖm€Ö äWÜƒô<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/00a9.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--copyright"
      title=":copyright:"
      alt="©"
    />!ÓléÎGÐÑ&lt;]…ò°ÿƒÒ‡~ì/c¹1½GAz¥82zù'Ú&gt;Å#G„¨J</em>, ich brauche das ganze aber als Hexwert, das wäre dann bei SHA512 <em>0226198a38c58db0f43f845549a11e1a3c323400dfd00fb5df25fbf97c5fed6fc90bc383a17d26de5bdea367369afc7ccd7fa7234052c67fc1a1fe83daf21c0e</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1457857</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1457857</guid><dc:creator><![CDATA[Cronkk]]></dc:creator><pubDate>Sun, 17 Feb 2008 21:48:45 GMT</pubDate></item><item><title><![CDATA[Reply to Passwort encrypten on Mon, 18 Feb 2008 01:16:29 GMT]]></title><description><![CDATA[<p>Den Zahlenwert eines Bytes hexadezimal ausgeben:</p>
<pre><code class="language-cpp">unsigned char my_char = 123;
stringstream ss;
ss &lt;&lt; hex &lt;&lt; static_cast&lt;unsigned int&gt;(my_char&gt;;
cout &lt;&lt; ss.str() &lt;&lt; endl;
</code></pre>
<p>Alternativ auch gleich in einen beliebigen Stream reinstreamen, ohne den Umweg über den stringstream.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1457939</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1457939</guid><dc:creator><![CDATA[Badestrand]]></dc:creator><pubDate>Mon, 18 Feb 2008 01:16:29 GMT</pubDate></item></channel></rss>