MD5 encryption extension


#1

Hi HAppyBuilders,

I saw some months ago about a MD5 extension, but the link is not working anymore. Does anyone know if there is another MD5 extension?


#2

use AES instead
for example using this extension https://puravidaapps.com/aes.php

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.


#3

This is my old API, just use it:
http://moliata.000webhostapp.com/api/md5/?input=YOUR_INPUT


#4

@Taifun, thanks for answer. The case is to be used with my SQLite database, which does not have this function. As I am taking data from my MySQL remote database in which all passwords are stored using MD5 encryption and it’s been saved into a local SQLite database, I need this function to check if the password in SQLite is the same as MySQL ones.

Anyway, thanks for suggestion!!


#5

@Ben, how do I use it in terms of a local SQlite database?


#6

TaiFun - plenty of applications use MD5 checksums for ensuring the integrity of a downloaded file. There are applications for which it is appropriate.

The lack of a hashing algorithm in core AI, either SHA256 or MD5 is just baffling to me. It seems like such a basic tool.


#7
  1. The passwords in that remote database might as well be in cleartext.

  2. Is your connection to that remote MySQL database encrypted? If not, you’re basically sending passwords over the open Internet in the clear. Not a good idea.


#8

for passwords actually you do not need encryption, use hash values instead, my tools extension offers a HmacSha256 hash value method

Hashing vs. Encryption algorithms

There is a fundamental difference between Hashing and Encryption algorithms, see this stackoverflow answer: Hashing is one way. You can not get your data/string from a hash code. Encryption is 2 way - you can decrypt again the encrypted string if you have the key with you.
In case you are interested in Hashing, for example to create a password hash, see my Tools Extension.

this is why the extension functionality is available to add features like this

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.


#9

Yes, it is, @Thomas_Leavitt


#10

aquí hay un código si aun lo necesitas te compilo la extensión


#11

Si, por supuesto, @Andres_Cotes!!! Si lo haces te lo agradezco muchisimo.


#12

You can use Taifun’s extension… I remember it has some hash methode, like md5, sha, …


#13

http://puravidaapps.com/tools.php

if you mean this link, there is no method


#14

Really? Well, i have never use it but on Taifun’s site we have this function : sha256

I dont see md5 but maybe you can use sha256, i will try later today and report here,


#15

You can use sha256, but that doesn’t satisfy the requirement of the original poster for an MD5 hash function. Maybe @Taifun will modify his extension to add it at some point?

The more I see gaps like this in core functionality, the more it seems to me that learning to write extensions is essential.


Class ref in pre-verified class resolved to
#16

co.com.dendritas.KleyberTool.aix (6,8 KB)

enjoy


#17
public class KleyberTool extends AndroidNonvisibleComponent implements Component {
public static final int VERSION = 1;
private ComponentContainer container;
private Context context;
private static final String LOG_TAG = "";




 public KleyberTool(ComponentContainer container) {
    super(container.$form());
    this.container = container;
    context = (Context) container.$context();
    Log.d(LOG_TAG, "KleyberTool" );
}

  
   @SimpleFunction(description = "")
public String EncodeMD5(String text){
	  
	return MD5.encrypt(text);
	 
}

  

 public static final class MD5 {

/**
 * Encrypt a text into MD5
 * @param text
 * @return MD5 encrypted text
 */
public final static String encrypt(final String text) {
    try {
        // Create MD5 Hash
        MessageDigest digest = MessageDigest
                .getInstance("MD5");
        digest.update(text.getBytes());
        byte messageDigest[] = digest.digest();

        // Create Hex String
        StringBuffer hexString = new StringBuffer();
        for (int i = 0; i < messageDigest.length; i++) {
            String h = Integer.toHexString(0xFF & messageDigest[i]);
            while (h.length() < 2)
                h = "0" + h;
            hexString.append(h);
        }
        return hexString.toString();

    } catch (NoSuchAlgorithmException e) {
        e.printStackTrace();
    }
      return "";
      }
  } 
  
 }

#18

:grin::grin::grin::grin::+1:


#19

Dude, you’re a stud. :slight_smile:


#20

:joy::joy::joy::joy::joy::joy::joy::joy::joy::joy: Thank you Andres!!! I was not expecting to see my name as a function!!! :joy::joy::joy::joy::wave::wave::+1::+1:

Thanks again!!!