<?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[BruteForce]]></title><description><![CDATA[<p>Hallo alle miteinander...</p>
<p>Ich versuche gerade ein Programm zu schreiben, welches mir in einer Art &quot;brutforce&quot; Verfahren alle verschiedenen Kombinationsmöglichkeiten auf listet in Abhängigkeit zu einer maximalen Stellenanzahl n, welche am Anfang gegeben wird.</p>
<p>Also angenomme ich habe n=3 und an jeder Stelle n können 3 verschiedene Werte stehen (-1 , 0 , 1). Ich habe zuerst versucht das ganze in Basic zu realisieren, nur erwies sich die Geschwindigkeit, mit der &quot;Keys&quot; erstellt werden, als nicht aktzeptabel <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_tongue"
      title=":P"
      alt="😛"
    /></p>
<p>Es wäre sehr nett wenn mir jemand ein paar Tips geben, oder wenn er viel Zeit, Lust und Lageweile hat vielleicht auch einen Lösungsansatz geben könnte.</p>
<p>mfg escio</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/223928/bruteforce</link><generator>RSS for Node</generator><lastBuildDate>Sat, 03 Oct 2026 12:18:01 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/223928.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 02 Oct 2008 16:07:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to BruteForce on Thu, 02 Oct 2008 16:07:05 GMT]]></title><description><![CDATA[<p>Hallo alle miteinander...</p>
<p>Ich versuche gerade ein Programm zu schreiben, welches mir in einer Art &quot;brutforce&quot; Verfahren alle verschiedenen Kombinationsmöglichkeiten auf listet in Abhängigkeit zu einer maximalen Stellenanzahl n, welche am Anfang gegeben wird.</p>
<p>Also angenomme ich habe n=3 und an jeder Stelle n können 3 verschiedene Werte stehen (-1 , 0 , 1). Ich habe zuerst versucht das ganze in Basic zu realisieren, nur erwies sich die Geschwindigkeit, mit der &quot;Keys&quot; erstellt werden, als nicht aktzeptabel <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_tongue"
      title=":P"
      alt="😛"
    /></p>
<p>Es wäre sehr nett wenn mir jemand ein paar Tips geben, oder wenn er viel Zeit, Lust und Lageweile hat vielleicht auch einen Lösungsansatz geben könnte.</p>
<p>mfg escio</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1592310</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1592310</guid><dc:creator><![CDATA[escio]]></dc:creator><pubDate>Thu, 02 Oct 2008 16:07:05 GMT</pubDate></item><item><title><![CDATA[Reply to BruteForce on Thu, 02 Oct 2008 16:17:54 GMT]]></title><description><![CDATA[<p>Geschachtelte for-Schleifen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1592319</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1592319</guid><dc:creator><![CDATA[moagnus]]></dc:creator><pubDate>Thu, 02 Oct 2008 16:17:54 GMT</pubDate></item><item><title><![CDATA[Reply to BruteForce on Thu, 02 Oct 2008 16:24:10 GMT]]></title><description><![CDATA[<p>Joa soweit dachte ich mir das schon <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_tongue"
      title=":P"
      alt="😛"
    /></p>
<p>Die Sache ist nur die, bei geschachtelten for-Schleifen muss ich doch per Hand für jedes &quot;n&quot; ne neue Schachtelung vornehmen, also im Quelltext.</p>
<p>Habe leider keine Ahung, wie ich ihm sagen kann, wieviele for-Schleifen er laufen lassen muss, denn umso höher n wird, desto höher wird doch auch die Anzahl der gebrauchten Schleifen?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1592323</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1592323</guid><dc:creator><![CDATA[escio]]></dc:creator><pubDate>Thu, 02 Oct 2008 16:24:10 GMT</pubDate></item><item><title><![CDATA[Reply to BruteForce on Thu, 02 Oct 2008 16:50:05 GMT]]></title><description><![CDATA[<p>Siehe hier <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-223783.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-223783.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1592339</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1592339</guid><dc:creator><![CDATA[Phoemuex]]></dc:creator><pubDate>Thu, 02 Oct 2008 16:50:05 GMT</pubDate></item><item><title><![CDATA[Reply to BruteForce on Thu, 02 Oct 2008 20:00:18 GMT]]></title><description><![CDATA[<p>geht das nicht mit permutationen?</p>
<p>da gibts ja in der stl ein paar gute funktionen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1592477</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1592477</guid><dc:creator><![CDATA[Skym0sh0]]></dc:creator><pubDate>Thu, 02 Oct 2008 20:00:18 GMT</pubDate></item><item><title><![CDATA[Reply to BruteForce on Thu, 02 Oct 2008 20:14:39 GMT]]></title><description><![CDATA[<p>Mit Permutationen ändert man ja nur die Reihenfolge von Elementen in einer Sequenz. Hier möchte man aber quasi &quot;hochzählen&quot; und bei einem Überlauf auch die Elementzahl ändern. Das hat nicht wirklich etwas mit Permutationen zu tun.</p>
<p>Felix</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1592484</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1592484</guid><dc:creator><![CDATA[Phoemuex]]></dc:creator><pubDate>Thu, 02 Oct 2008 20:14:39 GMT</pubDate></item><item><title><![CDATA[Reply to BruteForce on Fri, 03 Oct 2008 15:48:38 GMT]]></title><description><![CDATA[<p>Das hier hab ich iwann mal geschrieben, als mir langweilig war - sollte aber reichen ^^ includes musst du dir noch dazudenken (fstream, string, vector - sollte es gewesen sein)</p>
<pre><code class="language-cpp">namespace BruteForce
{
    template &lt;class CryptClass&gt; /*std::string CryptClass::EnCode (std::string)*/
    class TDepth
        {
        private:
            std::string m_Hash;
            std::string m_Ergebnis;
            std::vector &lt;char&gt; Characters;
            std::vector &lt;char&gt;::const_iterator Characters_first;
            std::vector &lt;char&gt;::const_iterator Characters_end;
            size_t m_Depth;
            std::ofstream&amp; output;
            bool doing (const std::string &amp;curr = &quot;&quot;, size_t length = 0)
				{
					if (CryptClass::EnCode (curr) == m_Hash)
					{
						m_Ergebnis = curr;
						return true;
					}
					else if (length != m_Depth)
					{
						++length;
						for (std::vector &lt;char&gt;::const_iterator iter (Characters_first); iter != Characters_end; ++iter)
						{
							if (doing (curr + *iter, length))
							return true;
						}
					}
					return false;
				}
			public:
				TDepth (const std::string &amp;hash = &quot;&quot;, std::ofstream &amp;_output = std::cout)
					: m_Hash (hash), Characters (0), output (_output)
					{}
				void SetHash (const std::string &amp;hash)					{m_Hash = hash;};
				std::string GetHash (void) const						{return m_Hash;};
				void SetDepth (const size_t &amp;depth)						{m_Depth = depth;};
				std::string GetErgebnis (void) const					{return m_Ergebnis;};
				void SetVector (const std::vector &lt;char&gt; &amp;newvector)	{Characters = newvector;};
				void AddCharacter (const char toadd)					{Characters.push_back (toadd);};
				bool CheckCharacter (const char toproof) const
				{
					for (std::vector &lt;char&gt;::const_iterator iter (Characters.begin ()); iter != Characters.end (); ++iter)
					{
						if (*iter == toproof)
							return true;
					}
					return false;
				}
				void AddCharacters (const std::string &amp;ToAdd)
				{
					for (std::string::const_iterator iter (ToAdd.begin ()); iter != ToAdd.end (); ++iter)
					{
						if (CheckCharacter (*iter))
							continue;
						Characters.push_back (*iter);
					}
				}
				void Do (void) throw (::my::exception::FAILED_OP)
				{
					if (CanPrint)
					{
						if (m_Hash.empty ())
							output &lt;&lt; &quot;warning: there isnt set a hash!&quot; &lt;&lt; std::endl;
						if (Characters.empty ())
							output &lt;&lt; &quot;warning: there isnt set any character!&quot; &lt;&lt; std::endl;
						if (!m_Depth)
							output &lt;&lt; &quot;warning: depth is zero!&quot; &lt;&lt; std::endl;
					}
					Characters_end = Characters.end ();
					Characters_first = Characters.begin ();
					if (!doing ())
						throw ::my::FAILED_OP (&quot;Advance parameters for solving this&quot;);
				}
}
</code></pre>
<p>my is nen namespace und failed_op is ne exception - kannst dafür auch std::runtime_exception nehmen oder so was in der richtung...</p>
<p>bb</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1593032</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1593032</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Fri, 03 Oct 2008 15:48:38 GMT</pubDate></item></channel></rss>