<?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[Usare i dati di login di Joomla con asp.net]]></title><description><![CDATA[<p dir="auto">Qualcuno sa come poter effettuare il login in <a href="http://asp.net" rel="nofollow ugc">asp.net</a> usando il database di joomla 1.5?<br />
La password è memorizzata nel database MySql con un hash <em>MD5</em>, ma non sono riuscito a capire come ricrearla uguale per confrontare se quella inserita combacia con quella nel database...<br />
Qualcuno mi può aiutare?</p>
]]></description><link>https://dev.connect.gt/topic/81245/usare-i-dati-di-login-di-joomla-con-asp-net</link><generator>RSS for Node</generator><lastBuildDate>Wed, 25 Nov 2026 20:10:49 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/81245.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 01 Sep 2008 18:16:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Usare i dati di login di Joomla con asp.net on Tue, 02 Sep 2008 09:58:39 GMT]]></title><description><![CDATA[<p dir="auto">hmm<br />
prima di rispondere avevo controllato nella mia installazione di joomla (1.5.6) e assunto (erroneamente) che anche la tua installazione non usasse salt</p>
]]></description><link>https://dev.connect.gt/post/754645</link><guid isPermaLink="true">https://dev.connect.gt/post/754645</guid><dc:creator><![CDATA[jocker]]></dc:creator><pubDate>Tue, 02 Sep 2008 09:58:39 GMT</pubDate></item><item><title><![CDATA[Reply to Usare i dati di login di Joomla con asp.net on Tue, 02 Sep 2008 09:56:02 GMT]]></title><description><![CDATA[<p dir="auto">E' la stessa cosa che ho fatto io!!!</p>
<p dir="auto">Il problema è che il risultato non è uguale a quello salvato nel database.<br />
La classe che java che ho messo sopra implementava anche il salt, e anche usando il salt, il risultato non cambia....</p>
<p dir="auto">Ricordo che sto parlando di Joomla 1.5<br />
C'è qualcosa che mi sfugge?</p>
]]></description><link>https://dev.connect.gt/post/754667</link><guid isPermaLink="true">https://dev.connect.gt/post/754667</guid><dc:creator><![CDATA[vayolet]]></dc:creator><pubDate>Tue, 02 Sep 2008 09:56:02 GMT</pubDate></item><item><title><![CDATA[Reply to Usare i dati di login di Joomla con asp.net on Tue, 02 Sep 2008 09:45:46 GMT]]></title><description><![CDATA[<p dir="auto">mamma mia quanto codice!</p>
<pre><code>using System.Security.Cryptography;
using System.Text;

static string getHash(string psw)
{
    MD5 md5 = new MD5CryptoServiceProvider();
    byte[] hash = Encoding.UTF8.GetBytes(psw);
    hash = md5.ComputeHash(hash);
    StringBuilder sb = new StringBuilder();
    foreach (byte b in hash)
         sb.Append(b.ToString("x2"));
    return sb.ToString();
}
</code></pre>
]]></description><link>https://dev.connect.gt/post/754644</link><guid isPermaLink="true">https://dev.connect.gt/post/754644</guid><dc:creator><![CDATA[jocker]]></dc:creator><pubDate>Tue, 02 Sep 2008 09:45:46 GMT</pubDate></item><item><title><![CDATA[Reply to Usare i dati di login di Joomla con asp.net on Tue, 02 Sep 2008 08:58:14 GMT]]></title><description><![CDATA[<p dir="auto">E' esattamente quello che faccio ma non mi ritorna la stessa stringa che c'è sul database.<br />
Ho trovato su  <a href="http://joomlaaa.com" rel="nofollow ugc">joomlaaa.com</a> una classe java dalla quale ho preso spunto per crearne una in C# ma non c'è stato niente da fare?<br />
La classe è questa:</p>
<p dir="auto">public class Joomla15PasswordHash<br />
{<br />
public static boolean check(String passwd,String dbEntry) {<br />
if (passwd==null || dbEntry==null || dbEntry.length()==0)<br />
throw new IllegalArgumentException();<br />
String[] arr = dbEntry.split(":",2);<br />
if (arr.length==2) {<br />
// new format as {HASH}:{SALT}<br />
String cryptpass = arr[0];<br />
String salt = arr[1];</p>
<p dir="auto">return md5(passwd+salt).equals(cryptpass);<br />
} else {<br />
// old format as {HASH} just like PHPbb and many other apps<br />
String cryptpass = dbEntry;</p>
<p dir="auto">return md5(passwd).equals(cryptpass);<br />
}<br />
}</p>
<pre><code>static Random _rnd;

public static String create(String passwd) {
   StringBuffer saltBuf = new StringBuffer();
   synchronized (Joomla15PasswordHash.class) {
</code></pre>
<p dir="auto">if (_rnd==null) _rnd=new SecureRandom();<br />
int i;<br />
for (i=0;i&lt;32;i++) {<br />
saltBuf.append(Integer.toString(_rnd.nextInt(36),36));<br />
}<br />
}<br />
String salt = saltBuf.toString();</p>
<pre><code>   return md5(passwd+salt)+":"+salt;
}

/** Takes the MD5 hash of a sequence of ASCII or LATIN1 characters,
 *  and returns it as a 32-character lowercase hex string.
 *
 *  Equivalent to MySQL's MD5() function 
 *  and to perl's Digest::MD5::md5_hex(),
 *  and to PHP's md5().
 *
 *  Does no error-checking of the input,  but only uses the low 8 bits
 *  from each input character.
 */
private static String md5(String data) {
   byte[] bdata = new byte[data.length()]; int i; byte[] hash;

   for (i=0;i&lt;data.length();i++) bdata*=(byte)(data.charAt(i)&amp;0xff );*

   *try {*
      *MessageDigest md5er = MessageDigest.getInstance("MD5");*
      *hash = md5er.digest(bdata);*
   *} catch (GeneralSecurityException e) { throw new RuntimeException(e); }*

   *StringBuffer r = new StringBuffer(32);*
   *for (i=0;i&lt;hash.length;i++) {*
      *String x = Integer.toHexString(hash*&amp;0xff);**
      **if (x.length()&lt;2) r.append("0");**
      **r.append(x);**
   **}**
   **return r.toString();**      
**}**
</code></pre>
<p dir="auto"><strong>}</strong></p>
]]></description><link>https://dev.connect.gt/post/754666</link><guid isPermaLink="true">https://dev.connect.gt/post/754666</guid><dc:creator><![CDATA[vayolet]]></dc:creator><pubDate>Tue, 02 Sep 2008 08:58:14 GMT</pubDate></item><item><title><![CDATA[Reply to Usare i dati di login di Joomla con asp.net on Tue, 02 Sep 2008 08:21:47 GMT]]></title><description><![CDATA[<p dir="auto">non so quale sia il problema che incontri: le password di joomla sono memorizzate come hai detto te, cioè oscurate con la funzione hash MD5, per giunta senza aggiungere sale.<br />
Per creare l'hash della parola "password" basta quindi fare MD5('password') nella query SQL, o usare il metodo ComputeHash della classe MD5CryptoServiceProvider e poi creare la rappresentazione esadecimale dei byte ottenuti</p>
]]></description><link>https://dev.connect.gt/post/754648</link><guid isPermaLink="true">https://dev.connect.gt/post/754648</guid><dc:creator><![CDATA[jocker]]></dc:creator><pubDate>Tue, 02 Sep 2008 08:21:47 GMT</pubDate></item></channel></rss>