??? ? ?? ??? Java? ??? API? ???? ??? ??????
Java? java.security
??? ? ?? ?? ??? ??? ??? API ??? ?????. ? API? ?? ???? ??? ? ?? ??? ??? ??? ??? ??? ?? ? ? ????. ??? ?? ???? Cipher
, SecretKey
, SecretKeyFactory
? KeyGenerator
???. ??? ?? ???? ???? ??? ?? ?? (AES ??)? ??? ????.
1. ? ?? :
?? ?? ?? ???????. ? ?? ??? ? ?? ??? ?????. ?? ?? ? ??? 256 ?? AES ?? ???? ??? ?????.
<code class="java">import javax.crypto.Cipher; import javax.crypto.KeyGenerator; import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; import java.util.Base64; public class AESEncryption { public static void main(String[] args) throws NoSuchAlgorithmException { // Generate a 256-bit AES key KeyGenerator keyGenerator = KeyGenerator.getInstance("AES"); keyGenerator.init(256, new SecureRandom()); SecretKey secretKey = keyGenerator.generateKey(); // ... (rest of the code for encryption and decryption) ... } }</code>
2. ??? :
?? ?? Cipher
???? ???? ???? ??? ? ? ????. ?? ??? PKCS5Padding? ???? CBC ???? AES? ???? ???? ????? ??? ?????.
<code class="java">import javax.crypto.Cipher; import javax.crypto.NoSuchPaddingException; import javax.crypto.SecretKey; import javax.crypto.spec.IvParameterSpec; import java.security.InvalidAlgorithmParameterException; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import java.util.Base64; import java.util.Arrays; // ... (previous code for key generation) ... byte[] iv = new byte[16]; // Initialization Vector (IV) - must be randomly generated new SecureRandom().nextBytes(iv); IvParameterSpec ivParameterSpec = new IvParameterSpec(iv); Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); cipher.init(Cipher.ENCRYPT_MODE, secretKey, ivParameterSpec); byte[] encryptedBytes = cipher.doFinal("This is my secret message".getBytes()); String encryptedString = Base64.getEncoder().encodeToString(iv) Base64.getEncoder().encodeToString(encryptedBytes); //Combine IV and encrypted data for later decryption System.out.println("Encrypted: " encryptedString); } }</code>
3. ?? ?? :
?? ??? ???? ????? Cipher.DECRYPT_MODE
?????. ??? ?, IV ? ???? ?? ??? ???????.
<code class="java">// ... (previous code for key generation and encryption) ... String[] parts = encryptedString.split("\\s "); // Split the string into IV and encrypted data byte[] decodedIv = Base64.getDecoder().decode(parts[0]); byte[] decodedEncryptedBytes = Base64.getDecoder().decode(parts[1]); IvParameterSpec ivParameterSpecDec = new IvParameterSpec(decodedIv); Cipher decipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); decipher.init(Cipher.DECRYPT_MODE, secretKey, ivParameterSpecDec); byte[] decryptedBytes = decipher.doFinal(decodedEncryptedBytes); System.out.println("Decrypted: " new String(decryptedBytes)); } }</code>
?? ???? ??? ???? ???????. ? ??? ?? ??? ?????. ?? ??? ????? ?? Keystores ? ?? ?? ?? ??? ???? ?? ??????.
Java ???? ??? ? ??? ? ????? ?? ??? ??????
?? ? ??? ????? ?? ?????. ??? ?? ???? ?? ?? ????. ?? ??? ??? ????.
- ??? ? ?? ?? : ? ??? ??? AES? ?? ???? (?? 256 ??)? ??????.
SecureRandom
? ?? ??? ??? ??? ?? ?? ??? (CSPRNG)? ??????. - ? ??? : ??????? ?? ?? ?? ?? ??? ?? ?? ?? ????? ????. JCA (Java Cryptography Architecture) ?? ?? ???? ?? ?? (HSM)? ???? ??? ? ???? ??????. Keystores? ?? ?? ? ? ????? ????? ?????.
- ? ?? : ??? ????? ???? ??? ??? ??? ?????. ??? ? ?? ????? ??????.
- ??? ?? : ?? ??? ??? ?? ?? ?? ???? ?????. ?? ? ?? ?? ??? ? ?? ????????.
- ? ?? : ??? ? ?? ???? ?? ?? ???? ??????. ?? ???? ?? ? ?? ?? ???? ?? ????? HSM??? ??? ?? ?? ????? ?????.
- ? ???? ????? : ?? ???? ?? ?? ?????? ??? ?? ????? ????.
- KMS (Key Management System) ?? : ?????? ?? ??????? ?? ?? ??? ??? ??, ?? ? ?? ?? ????? ??? ?? ?? ??? ???? ?? KMS? ???? ?? ??????.
?? ?? ??? ?? ??? Java ??? ????? ??????
???? ??? ?? ?? ??? ??? ?? ????. ??? ??? ??? ????.
-
?? ??? (?? ??) :
- AES (Advanced Encryption Standard) : ???? ?? ?????? ?? ???? ???? ?? ?????? ?? ??? ????. ?? ??? ?? 256 ?? ?? ??????.
- Chacha20 : ?? ??? ??? ????? ??? ?? ? ??? ???? ?? ??? ??.
-
??? ??? (?? ? ??? ?? ?) :
- RSA : ??? ?? ? ? ??? ?? ???? ????. ??? ?? ?????? ????? ? ????. 2048 ?? ??? ?? ??? ??????.
- ECC (Elliptic Curve cryptography) : ? ??? ?? RSA? ??? ??? ????? ???? ??? ??? ? ??????.
-
?? (??? ? ??) :
- SHA-256/SHA-512 : ?? ??? ???? ?? ?? ????. SHA-512? ?? ? ?? ??? ????? ????? ? ????.
- HMAC (?? ?? ??? ?? ??) : ??? ?? ? ???? ?????. SHA-256 ?? SHA-512? ?? ??? ?? ??? ??????.
-
??? ?? (?? ? ? ?? ?) :
- RSA ? ECDSA (?? ?? ??? ?? ????) : ? ? ??? ??? ??? ? ?? ?????. ECDSA? ????? RSA?? ? ??????.
???? ?? ?? ??? ????? ???? ?? ??? ??? ??? ?? ??? ????? ?? ???????.
Java?? ??? ? ?? ??? ??? ? ??? ? ???? ??? ?????
? ?? ???? ??? ??? ??? ??? ???? ? ????.
- ??? IV ?? : CBC ???? AES? ?? ?? ??? ?? ? ?? ?? ??? IV? ???? ??? ?? ?? ???. ? ??? ??? ?? ?? ??? ??? ??? ??? IV? ??????.
- ???? ?? ?? ? ? : ???? ?? ?? ?? ?? ?? ???? ????. ??? ? ???? ???? ?? ?? ?? ??? ?????.
- ???? ?? : ?????? ???? ?? ?? ??? ???? ?? Oracle ??? ?? ????? ??? ? ????. pkcs5padding ?? pkcs7padding? ?? ? ?? ? ?? ??? ??????.
- ???? ?? : ???? ????? ????? ?? ???? ??? ???? ?? ? ? ????. ?? ????? ?? ?? ??? ???? ???? ??? ???? ? ?? ??? ??????.
- ? ?? ??? : ?? ?? ? ??? ???? ???? ??? ? ??? ?? ????. ??? ?????? ?? ?? ? ??? ??????.
- ?? ?? ?? : ???? ??? ???? ???? ???? ?? ?????. ??? ???? ??? ????? ??? ??? ??? ? ????.
- ???? ??? ?? : ??? ?? ???? ???? ??? ?? ??? ??? ? ????. ????? ?? ???? ???? ?????.
- ??? ??? ?? ?? : ?? ?? ?? ???? ???? ?? IV? ??? ?? ? ? ????. ??
SecureRandom
? ?? CSPRNG? ??????.
??? ??? ???? ???? ?? ??? ??? Java ??? ??? ??? ?? ???? ? ????. ??? ???? ?????? ?? ?? ?? ? ?? ??? ?????? ?? ?????.
? ??? ??? ? ?? ??? Java? ??? API? ??? ??????? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

JavaScript? ??? ?? ????? ??? ?? ??? ??? ?? ?? ?? ????? ?? ???? ???? ?????. ??? ?? ???? ?? ??? ?? ??? ???? ???? ?? ?? ???? ???? ?????. ?? ??, ??? ? ?? ???? ??? (? : ??? null? ??) ?? ??? ????? ??????. ??? ??? ???? ??? ??? ????. closure?? ?? ??? ?? ??; ? ??? ??? ?? ?? ???? ?? ???? ????. V8 ??? ?? ???, ?? ??, ??/?? ???? ?? ??? ?? ??? ??? ????? ?? ??? ?? ??? ????. ?? ?? ???? ??? ??? ??? ??? ???? ????? ?? ?? ???? ?? ???????.

Node.js?? HTTP ??? ???? ? ?? ???? ??? ????. 1. ?? ????? ????? ??? ??? ? ?? ????? ?? ?? ? https.get () ??? ?? ??? ??? ? ?? ????? ?? ??? ?????. 2.axios? ??? ???? ? ?? ??????. ??? ??? ??? ??? ??? ??? ???/???, ?? JSON ??, ???? ?? ?????. ??? ?? ??? ????? ?? ????. 3. ?? ??? ??? ??? ??? ???? ???? ??? ??? ???? ?????.

JavaScript ??? ??? ?? ?? ? ?? ???? ????. ?? ???? ???, ??, ??, ?, ???? ?? ? ??? ?????. ?? ????? ?? ?? ? ? ??? ????? ?? ??? ??? ????. ??, ?? ? ??? ?? ?? ??? ??? ??? ???? ??? ??? ???? ??? ?? ??? ????. ?? ? ????? ??? ???? ? ??? ? ??? TypeofNull? ??? ?????? ??? ? ????. ? ? ?? ??? ???? ?????? ????? ???? ??? ???? ? ??? ? ? ????.

?????, JavaScript ???! ?? ? JavaScript ??? ?? ?? ?????! ?? ?? ??? ??? ??? ? ????. Deno?? Oracle? ?? ??, ??? JavaScript ?? ??? ????, Google Chrome ???? ? ??? ??? ???? ?????. ?????! Deno Oracle? "JavaScript"??? ????? Oracle? ?? ??? ??? ??????. Node.js? Deno? ??? ? Ryan Dahl? ??? ?????? ???? ????? JavaScript? ??? ???? Oracle? ????? ???? ?????.

?? JavaScript ??? ??? ??? ?????? ?? ??? ?? ?? ??? ?? ???? ????. 1. ??? ???? ???? ?? ??? ?? ? ? ???? ??? ??? ?? ? ?? ????? ?????. 2. Angular? ?????? ??? ?? ???? ? ?? ?? ??? ??? ??? ???? ?????. 3. VUE? ???? ?? ??? ???? ?? ?? ??? ?????. ?? ?? ?? ??, ? ??, ???? ???? ? SSR? ???? ??? ??? ??? ???? ? ??? ?????. ???, ??? ??? ??? ????? ????. ??? ??? ??? ??? ?? ????.

iife (?? invokedfunctionexpression)? ?? ??? ???? ?? ????? ??? ???? ?? ??? ????? ?? ??? ? ?????. ??? ?? ?? ??? ???? ? ?? ??? ??? ?? (function () {/code/}) ();. ?? ???? ??? ?????. 1. ?? ??? ??? ?? ???? ?? ??? ??? ?????. 2. ?? ??? ??? ???? ?? ?? ??? ????. 3. ?? ?? ??? ????? ?? ???? ???????? ?? ? ??. ???? ?? ???? ?? ??? ES6 ??? ??? ??? ?? ? ??? ????? ??? ? ???? ???????.

??? JavaScript?? ??? ??? ?????? ?? ???????. ?? ??, ?? ?? ? ??? ??? ?? ????? ????? ?????. 1. ?? ??? ??? ????? ???? ??. ()? ?? ??? ??? ?????. ?. ()? ?? ??? ?? ??? ??? ?? ? ? ????. 2. ?? ??? .catch ()? ???? ?? ??? ??? ?? ??? ??????, ??? ???? ???? ????? ??? ? ????. 3. Promise.all ()? ?? ????? (?? ?? ?? ? ??????? ??), Promise.Race () (? ?? ??? ?? ?) ? Promise.AllSettled () (?? ??? ???? ??)

Cacheapi? ?????? ?? ???? ??? ???? ???, ?? ??? ??? ?? ???? ? ??? ?? ? ???? ??? ??????. 1. ???? ????, ??? ??, ?? ?? ?? ???? ???? ??? ? ????. 2. ??? ?? ?? ??? ?? ? ? ????. 3. ?? ?? ?? ?? ?? ??? ??? ?? ?????. 4. ??? ???? ?? ?? ???? ?? ?? ?? ?? ?? ???? ?? ?? ??? ??? ? ????. 5. ?? ???? ??, ??? ??? ? ??? ??, ?? ??? ? ?? ???? ???? ???? ? ?? ?????. 6.?? ??? ?? ?? ?? ??, ???? ?? ? HTTP ?? ????? ?????? ???????.
