質問編集履歴
1
処理を明確化
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,13 +16,27 @@
|
|
16
16
|
|
17
17
|
```php
|
18
18
|
|
19
|
+
$data = '暗号化文字列';
|
20
|
+
|
19
21
|
$n = 'ある値';
|
20
22
|
|
21
23
|
$nonceBinary = bin2hex($n);
|
22
24
|
|
23
25
|
$hash = hash('sha256', $nonceBinary);
|
24
26
|
|
25
|
-
$
|
27
|
+
$key = mb_strcut($hash, 0, 16, 'UTF-8');
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
return openssl_encrypt(
|
32
|
+
|
33
|
+
$data,
|
34
|
+
|
35
|
+
'AES-256-ECB',
|
36
|
+
|
37
|
+
$key
|
38
|
+
|
39
|
+
);
|
26
40
|
|
27
41
|
```
|
28
42
|
|