-
-
Save ioleksiy/1960145 to your computer and use it in GitHub Desktop.
PhoneGap Application Encryption
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void) fetchKey:(char[]) key | |
{ | |
//ffffffffffffffffffffffffffffffff | |
key[0] = 0x66; | |
key[1] = 0x66; | |
key[2] = 0x66; | |
key[3] = 0x66; | |
key[4] = 0x66; | |
key[5] = 0x66; | |
key[6] = 0x66; | |
key[7] = 0x66; | |
key[8] = 0x66; | |
key[9] = 0x66; | |
key[10] = 0x66; | |
key[11] = 0x66; | |
key[12] = 0x66; | |
key[13] = 0x66; | |
key[14] = 0x66; | |
key[15] = 0x66; | |
key[16] = 0x66; | |
key[17] = 0x66; | |
key[18] = 0x66; | |
key[19] = 0x66; | |
key[20] = 0x66; | |
key[21] = 0x66; | |
key[22] = 0x66; | |
key[23] = 0x66; | |
key[24] = 0x66; | |
key[25] = 0x66; | |
key[26] = 0x66; | |
key[27] = 0x66; | |
key[28] = 0x66; | |
key[29] = 0x66; | |
key[30] = 0x66; | |
key[31] = 0x66; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
function icrypt($plaintext, $key) { | |
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB); | |
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); | |
return mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $plaintext, MCRYPT_MODE_ECB); | |
} | |
//usage: | |
$newHtml = icrypt('<html></html>', 'ffffffffffffffffffffffffffffffff'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The article http://www.oleksiy.pro/2011/09/20/phonegap-application-encryption/