This file contains hidden or 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
GET https://fxrate.staging-cpg.online/api/v1/fx?limit=1 |
This file contains hidden or 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
/* | |
HTML is the language that describes how web content is formatted and presented. | |
CSS is the language that describes the appearance of that content. | |
The two languages—HTML and CSS—are independent of one another and should remain that way. CSS should not be written inside of an HTML document and vice versa. | |
There are a few common terms to CSS and how it targets elements in HTML and sets their appearance. | |
Selectors generally target an attribute value, such as an id or class value, or target the type of element, such as <h1> or <p>. Once an element is selected, a property determines the styles that will be applied to that element. So far we’ve selected an element with a selector and determined what style we’d like to apply with a property. Now we can determine the behavior of that property with a value. |
This file contains hidden or 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
Hello | |
If you're using a laptop for this class you probably want to setup Visual Studio Code(https://code.visualstudio.com/download), because familiarity with this tool in itself is an advantage. | |
If you're using an Android smartphone then you want to get Spck Editor(https://play.google.com/store/apps/details?id=io.spck&hl=en_CA&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1), you can read more about that here(https://spck-code-editor.readthedocs.io/en/latest/#android-app) | |
If you're using an iPhone, you can afford a laptop or you should. | |
Just kidding, if for some reason all you have is a device that can access the internet, you can use https://spck.io/ as your coding platform, it is full-featured. |
This file contains hidden or 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
public function encrypt3Des($data, $key) | |
{ | |
//Generate a key from a hash | |
$key = md5(utf8_encode($key), true); | |
//Take first 8 bytes of $key and append them to the end of $key. | |
$key .= substr($key, 0, 8); | |
//Pad for PKCS7 | |
$blockSize = mcrypt_get_block_size('tripledes', 'ecb'); |
This file contains hidden or 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
import java.io.UnsupportedEncodingException; | |
import java.security.InvalidKeyException; | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
import java.util.Arrays; | |
import javax.crypto.BadPaddingException; | |
import javax.crypto.Cipher; | |
import javax.crypto.IllegalBlockSizeException; | |
import javax.crypto.NoSuchPaddingException; | |
import javax.crypto.SecretKey; |
This file contains hidden or 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
public String harden(String unencryptedString) throws NoSuchAlgorithmException, UnsupportedEncodingException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException { | |
MessageDigest md = MessageDigest.getInstance("md5"); | |
byte[] digestOfPassword = md.digest(key.getBytes("utf-8")); | |
byte[] keyBytes = Arrays.copyOf(digestOfPassword, 24); | |
for (int j = 0, k = 16; j < 8;) { | |
keyBytes[k++] = keyBytes[j++]; | |
} | |
SecretKey secretKey = new SecretKeySpec(keyBytes, "DESede"); |