{"id":693,"date":"2020-05-13T14:28:37","date_gmt":"2020-05-13T18:28:37","guid":{"rendered":"https:\/\/www.johnconde.net\/blog\/?p=693"},"modified":"2023-01-06T12:04:37","modified_gmt":"2023-01-06T16:04:37","slug":"php-simple-encryption","status":"publish","type":"post","link":"https:\/\/website-0f9bf4a4.hpx.ppi.temporary.site\/blog\/php-simple-encryption\/","title":{"rendered":"PHP Simple Encryption"},"content":{"rendered":"<div class=\"note yellownote\">\n    <img loading=\"lazy\" decoding=\"async\" class=\"avatar photo githubicon\" src=\"\/images\/icons\/github.png\" alt=\"Github\" width=\"68\" height=\"68\"\/>If you find this tutorial and code useful, please take a moment to <a href=\"https:\/\/github.com\/stymiee\/php-simple-encryption\" rel=\"external\">star it on Github<\/a>. If you want to help develop it further, <a href=\"https:\/\/github.com\/stymiee\/php-simple-encryption\/fork\">fork it<\/a>.<\/p>\n<ul id=\"github-icons\">\n<li><iframe loading=\"lazy\" class=\"github-btn\" src=\"https:\/\/ghbtns.com\/github-btn.html?user=stymiee&amp;repo=php-simple-encryption&amp;type=watch&amp;count=true\" width=\"100px\" height=\"20px\" frameborder=\"0\" scrolling=\"0\" title=\"Watch stymiee\/php-simple-encryption on GitHub\"><\/iframe><\/li>\n<li><iframe loading=\"lazy\" class=\"github-btn\" src=\"https:\/\/ghbtns.com\/github-btn.html?user=stymiee&amp;repo=php-simple-encryption&amp;type=fork&amp;count=true\" width=\"98px\" height=\"20px\" frameborder=\"0\" scrolling=\"0\" title=\"Fork stymiee\/php-simple-encryption on GitHub\"><\/iframe><\/li>\n<li><iframe loading=\"lazy\" class=\"github-btn\" src=\"https:\/\/ghbtns.com\/github-btn.html?user=stymiee&amp;type=follow&amp;count=true\" frameborder=\"0\" scrolling=\"0\" width=\"170\" height=\"20\" title=\"Follow @stymiee on GitHub\"><\/iframe><\/li>\n<\/ul>\n<\/div>\n<p>Encryption is a complicated topic and one that, when done incorrectly, could result in sensitive data being exposed to bad actors or lost due to an inability to decrypt that data at a later date.<\/p>\n<p>The <a href=\"https:\/\/github.com\/stymiee\/php-simple-encryption\" rel=\"external\">PHP Simple Encryption<\/a> library is designed to simplify the process of encrypting and decrypting data while ensuring best practices are followed. By default is uses a secure encryption algorithm and generates a cryptologically strong initialization vector (more on that later) so developers do not need to become experts in encryption to securely store sensitive data.<\/p>\n<h2>\n    Requirements<\/h2>\n<ul>\n<li>PHP 7.2+<\/li>\n<li>Openssl PHP extension<\/li>\n<\/ul>\n<h2>\n    Installation<\/h2>\n<p>To add PHP Simple Encryption to your project, add a dependency on stymiee\/php-simple-encryption to your project&#8217;s composer.json file if you use Composer to manage the dependencies of your project. Here is a minimal example of a composer.json file that just defines a dependency on PHP Simple Encryption:<\/p>\n<pre lang=\"php\">\"require\": {\r\n    \"stymiee\/php-simple-encryption\": \"^1\"\r\n}\r\n<\/pre>\n<p>Including it in your project is then as simple as including your vendor autoload file:<\/p>\n<pre lang=\"php\">require('.\/vendor\/autoload.php');\r\n<\/pre>\n<h2>\n    Basic Usage<\/h2>\n<p>Most encryption ciphers require three items to successfully encrypt text:<\/p>\n<ol class=\"indent\">\n<li>A secret key (think of this as the password of the encrypted text)<\/li>\n<li>An <a href=\"https:\/\/en.wikipedia.org\/wiki\/Initialization_vector\" rel=\"external\">initialization vector (IV)<\/a><\/li>\n<li>The text to be encrypted<\/li>\n<\/ol>\n<p>The steps to properly encrypt text is as follows:<\/p>\n<ol class=\"indent\">\n<li>Create a secret key<\/li>\n<li>Create a secure, randomly generated initialization vector<\/li>\n<li>Encrypt the text using the secret key and IV<\/li>\n<li>Securely store the secret key and IV for later use to decrypt the encrypted text<\/li>\n<\/ol>\n<p>The steps to properly decrypt encrypted text is as follows:<\/p>\n<ol class=\"indent\">\n<li>Securely retrieve the secret key and IV<\/li>\n<li>Decrypt the text using the secret key and IV<\/li>\n<\/ol>\n<p>Below is an example showing both the encryption and decryption of text. Normally you would not encrypt data and then immediately decrypt it, but this is for illustration purposes only.<\/p>\n<pre lang=\"php\">use Encryption\\Encryption;\r\nuse Encryption\\Exception\\EncryptionException;\r\n\r\n$text = 'Testing, testing, 123';\r\n$key  = 'secretkey';\r\ntry {\r\n    $encryption = Encryption::getEncryptionObject();\r\n    $iv = $encryption->generateIv();\r\n    $encryptedText = $encryption->encrypt($text, $key, $iv);\r\n    $decryptedText = $encryption->decrypt($encryptedText, $key, $iv);\r\n    \r\n    printf('Cipher   : %s%s', $encryption->getName(), PHP_EOL);\r\n    printf('IV       : %s%s', base64_encode($iv), PHP_EOL);\r\n    printf('Encrypted: %s%s', $encryptedText, PHP_EOL);\r\n    printf('Decrypted: %s%s', $decryptedText, PHP_EOL);\r\n}\r\ncatch (EncryptionException $e) {\r\n    echo $e;\r\n}\r\n<\/pre>\n<p>Outputs<\/p>\n<pre>Cipher   : AES-256-CBC\r\nIV       : Cz5BfO8PDgwFTlDNXoFiAQ==\r\nEncrypted: Hj3xYHJnTWq5ZkHRGbnGdh4qRXd3PEzgI0Rbru9GynY=\r\nDecrypted: Testing, testing, 123\r\n<\/pre>\n<p>You will notice the secret key is in plain text in the example above. This value is something you can create however you want. Randomness is not considered important here. However, your initialization vector (IV) should be as random as possible. A common pitfall developers fall into when creating an IV is to choose a method of generation that is insufficiently random if it is random at all.<\/p>\n<p>PHP Simple Encryption solves that problem by handling IV generation. IVs are generated using <code>openssl_random_pseudo_bytes()<\/code> which generates a random string of bytes (of a chosen length). The randomness of these bytes will be cryptologically strong and should always be preferred to a home grown solution. Additionally, if a better method should become available, by using PHP Simple Encryption to generate your IV you can gain this benefit simply by updating your version of the library without the need to make any changes in your code.<\/p>\n<p>But what happens if <code>openssl_random_pseudo_bytes()<\/code> is unable to generate a cryptologically strong string of bytes? If this were to occur, most likely because the application is running on a older system, the library falls back to <code>random_bytes()<\/code> which is PHP&#8217;s built in equivalent to <code>openssl_random_pseudo_bytes()<\/code>.<\/p>\n<p>In the unlikely event that <code>openssl_random_pseudo_bytes()<\/code> and <code>random_bytes()<\/code> both fail to produce an IV, the library offers the option to fall back to a built in random string generator. This IV generator does <b>not<\/b> generate a cryptologically strong value and should not be used in any environment where data security is a requirement. This can be enabled by passing <code>true<\/code> to <code>generateIv()<\/code>:<\/p>\n<pre lang=\"php\">$iv = $encryption->generateIv(true);\r\n<\/pre>\n<p>\n    <code>true<\/code> should be a boolean and not a string or number.\n<\/p>\n<div class=\"note yellownote\">\n    Unless encryption is an unnecessary additional layer of security, an abundance of caution should be used when enabling this option.<\/div>\n<p>Once you have generated an IV, you can use it to encrypt you value. But to decrypt that value later you will need that IV as part of the decryption process. <code>generateIv()<\/code> will generate bytes that are not human friendly (but still computer friendly). To make it easier for humans to work with you should consider base64 encoding that string when storing it:<\/p>\n<pre lang=\"php\">$savedIv = base64_encode($iv);\r\n<\/pre>\n<p>By default, PHP Simple Encryption uses the AES with 256-bit encryption in CBC (Cipher Blocker Chaining) mode (AES-256-CBC). This form of encryption is considered very secure which is why it is the default encryption method when encrypting data using this library. However, your business requirements may require you to use a different cipher. Perhaps to decrypt text encrypted by a third party or before this method of encryption was available. You can set the encryption cipher to any cipher supported by your system <i>and<\/i> the PHP Simple Encryption library. To do this you specify the name of the encryption cipher you wish to use when creating your encryption object.<\/p>\n<pre lang=\"php\">$encryption = Encryption::getEncryptionObject('SM4-CFB');\r\n<\/pre>\n<p>Not every encryption algorithm requires an IV. Electronic codebook (ECB) mode is one such example.<\/p>\n<pre lang=\"php\">use Encryption\\Encryption;\r\nuse Encryption\\Exception\\EncryptionException;\r\n\r\n$text = 'Testing, testing, 123';\r\n$key  = 'secretkey';\r\ntry {\r\n    $encryption = Encryption::getEncryptionObject('AES-128-ECB');\r\n    $encryptedText = $encryption->encrypt($text, $key);\r\n    $decryptedText = $encryption->decrypt($encryptedText, $key);\r\n    \r\n    printf('Cipher   : %s%s', $encryption->getName(), PHP_EOL);\r\n    printf('Encrypted: %s%s', $encryptedText, PHP_EOL);\r\n    printf('Decrypted: %s%s', $decryptedText, PHP_EOL);\r\n}\r\ncatch (EncryptionException $e) {\r\n    echo $e;\r\n}\r\n<\/pre>\n<p>Outputs<\/p>\n<pre>Cipher   : AES-128-ECB\r\nEncrypted: 2d8vGmPYXNIRbsvjnXgyzoIBEq0pAelbfYZSIakP+k8=\r\nDecrypted: Testing, testing, 123\r\n<\/pre>\n<p><div class=\"note yellownote\">\n    ECB mode is not recommended for use in cryptographic protocols and you should not use them unless you are working with a legacy system that requires its use.<\/div>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Authenticated_encryption\" rel=\"external\">Authenticated encryption with associated data (AEAD)<\/a> takes encryption a step further and in addition to securing the data through encryption, it ensures the data&#8217;s authenticity as well. In addition to outputting encrypted text it also provides an authentication tag. This tag is used to authenticate the encrypted text. In other words it validates that the tag matches the encrypted text generated with it. CCM and GCM mode ciphers use this form of encryption.<\/p>\n<pre lang=\"php\">use Encryption\\Encryption;\r\nuse Encryption\\Exception\\EncryptionException;\r\n\r\n$text = 'Testing, testing. 123';\r\n$key  = 'secretkey';\r\ntry {\r\n    $encryption = Encryption::getEncryptionObject('AES-128-GCM');\r\n    $iv = $encryption->generateIv();\r\n    $encryptedText = $encryption->encrypt($text, $key, $iv, $tag);\r\n    $decryptedText = $encryption->decrypt($encryptedText, $key, $iv, $tag);\r\n    \r\n    printf('Cipher   : %s%s', $encryption->getName(), PHP_EOL);\r\n    printf('IV       : %s%s', base64_encode($iv), PHP_EOL);\r\n    printf('Tag      : %s%s', base64_encode($tag), PHP_EOL);\r\n    printf('Encrypted: %s%s', $encryptedText, PHP_EOL);\r\n    printf('Decrypted: %s%s', $decryptedText, PHP_EOL);\r\n}\r\ncatch (EncryptionException $e) {\r\n    echo $e;\r\n}\r\n<\/pre>\n<p>Outputs<\/p>\n<pre>Cipher   : AES-128-GCM\r\nIV       : \/x3+e5+XCnjpf5ec\r\nTag      : yRuma5vRLsIfh\/WIevOhEA==\r\nEncrypted: HJr+C5BUgcwf537RDSNcIysULilYP+Rq\r\nDecrypted: Testing, testing. 123\r\n<\/pre>\n<p>Under the hood of <code>Encryption::encrypt()<\/code> the <code>$tag<\/code> parameter is passed by reference to <code>openssl_encrypt()<\/code>. A value is assigned to it upon a successful function call. You will need to store value. Like the IV, you may want to base64 encode it.<\/p>\n<div class=\"note yellownote\">\n    When using the PHP Simple Encryption library, if the text to be encrypted contains trailing null characters they will be removed when decrypting those values.<\/div>\n<h2>\n    Supported Ciphers<\/h2>\n<p>The PHP Simple Encryption library currently defaults to <code>AES-256-CBC<\/code>. This may change in future versions and will result in a major version bump when this occurs. To determine what cipher you are using you can call the <code>getName()<\/code> method on your encryption object:<\/p>\n<pre lang=\"php\">$encryption = Encryption::getEncryptionObject();\r\n$cipherName = $encryptuion->getName(); \/\/ AES-256-CBC\r\n<\/pre>\n<p>To get a list of ciphers supported by your system and this library you can call <code>Encryption::listAvailableCiphers()<\/code> to receive an array of available ciphers. This list is an intersection of available ciphers from your system&#8217;s installed version of Openssl <i>and<\/i> ciphers supported by this library.<\/p>\n<pre lang=\"php\">$availableCiphers = Encryption::listAvailableCiphers();\r\nvar_export($availableCiphers);\r\n<\/pre>\n<p>Below is a list of PHP Simple Encryption&#8217;s supported ciphers as of the release of version 1.0.0:<\/p>\n<table class=\"stripe fullsize\">\n<thead>\n<tr>\n<th>AES<\/th>\n<th>Aria<\/th>\n<th>Blowfish\/Camellia<\/th>\n<th>Cast5\/DES<\/th>\n<th>Idea\/RC2\/SeedSM4<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>aes-128-cbc<\/td>\n<td>aria-128-cbc<\/td>\n<td>bf-cbc<\/td>\n<td>cast5-cbc<\/td>\n<td>id-aes128-ccm<\/td>\n<\/tr>\n<tr>\n<td>aes-128-ccm<\/td>\n<td>aria-128-ccm<\/td>\n<td>bf-cfb<\/td>\n<td>cast5-cfb<\/td>\n<td>id-aes128-gcm<\/td>\n<\/tr>\n<tr>\n<td>aes-128-cfb<\/td>\n<td>aria-128-cfb<\/td>\n<td>bf-ecb<\/td>\n<td>cast5-ecb<\/td>\n<td>id-aes192-ccm<\/td>\n<\/tr>\n<tr>\n<td>aes-128-cfb1<\/td>\n<td>aria-128-cfb1<\/td>\n<td>bf-ofb<\/td>\n<td>cast5-ofb<\/td>\n<td>id-aes192-gcm<\/td>\n<\/tr>\n<tr>\n<td>aes-128-cfb8<\/td>\n<td>aria-128-cfb8<\/td>\n<td>camellia-128-cbc<\/td>\n<td>chacha20<\/td>\n<td>id-aes256-ccm<\/td>\n<\/tr>\n<tr>\n<td>aes-128-ctr<\/td>\n<td>aria-128-ctr<\/td>\n<td>camellia-128-cfb<\/td>\n<td>chacha20-poly1305<\/td>\n<td>id-aes256-gcm<\/td>\n<\/tr>\n<tr>\n<td>aes-128-ecb<\/td>\n<td>aria-128-ecb<\/td>\n<td>camellia-128-cfb<\/td>\n<td>des-cbc<\/td>\n<td>idea-cbc<\/td>\n<\/tr>\n<tr>\n<td>aes-128-gcm<\/td>\n<td>aria-128-gcm<\/td>\n<td>camellia-128-cfb<\/td>\n<td>des-cfb<\/td>\n<td>idea-cfb<\/td>\n<\/tr>\n<tr>\n<td>aes-128-ofb<\/td>\n<td>aria-128-ofb<\/td>\n<td>camellia-128-ctr<\/td>\n<td>des-cfb1<\/td>\n<td>idea-ecb<\/td>\n<\/tr>\n<tr>\n<td>aes-128-xts<\/td>\n<td>aria-192-cbc<\/td>\n<td>camellia-128-ecb<\/td>\n<td>des-cfb8<\/td>\n<td>idea-ofb<\/td>\n<\/tr>\n<tr>\n<td>aes-192-cbc<\/td>\n<td>aria-192-ccm<\/td>\n<td>camellia-128-ofb<\/td>\n<td>des-ecb<\/td>\n<td>rc2-40-cbc<\/td>\n<\/tr>\n<tr>\n<td>aes-192-ccm<\/td>\n<td>aria-192-cfb<\/td>\n<td>camellia-192-cbc<\/td>\n<td>des-ede-cbc<\/td>\n<td>rc2-64-cbc<\/td>\n<\/tr>\n<tr>\n<td>aes-192-cfb<\/td>\n<td>aria-192-cfb<\/td>\n<td>camellia-192-cfb<\/td>\n<td>des-ede-cfb<\/td>\n<td>rc2-cbc<\/td>\n<\/tr>\n<tr>\n<td>aes-192-cfb1<\/td>\n<td>aria-192-cfb8<\/td>\n<td>camellia-192-cfb<\/td>\n<td>des-ede-ofb<\/td>\n<td>rc2-cfb<\/td>\n<\/tr>\n<tr>\n<td>aes-192-cfb8<\/td>\n<td>aria-192-ctr<\/td>\n<td>camellia-192-cfb<\/td>\n<td>des-ede3-cbc<\/td>\n<td>rc2-ecb<\/td>\n<\/tr>\n<tr>\n<td>aes-192-ctr<\/td>\n<td>aria-192-ecb<\/td>\n<td>camellia-192-ctr<\/td>\n<td>des-ede3-cfb<\/td>\n<td>rc2-ofb<\/td>\n<\/tr>\n<tr>\n<td>aes-192-ecb<\/td>\n<td>aria-192-gcm<\/td>\n<td>camellia-192-ecb<\/td>\n<td>des-ede3-cfb1<\/td>\n<td>seed-cbc<\/td>\n<\/tr>\n<tr>\n<td>aes-192-gcm<\/td>\n<td>aria-192-ofb<\/td>\n<td>camellia-192-ofb<\/td>\n<td>des-ede3-cfb8<\/td>\n<td>seed-cfb<\/td>\n<\/tr>\n<tr>\n<td>aes-192-ofb<\/td>\n<td>aria-256-cbc<\/td>\n<td>camellia-256-cbc<\/td>\n<td>des-ede3-ofb<\/td>\n<td>seed-ecb<\/td>\n<\/tr>\n<tr>\n<td>aes-256-cbc<\/td>\n<td>aria-256-ccm<\/td>\n<td>camellia-256-cfb<\/td>\n<td>des-ofb<\/td>\n<td>seed-ofb<\/td>\n<\/tr>\n<tr>\n<td>aes-256-ccm<\/td>\n<td>aria-256-cfb<\/td>\n<td>camellia-256-cfb<\/td>\n<td>desx-cbc<\/td>\n<td>sm4-cbc<\/td>\n<\/tr>\n<tr>\n<td>aes-256-cfb<\/td>\n<td>aria-256-cfb1<\/td>\n<td>camellia-256-cfb<\/td>\n<td>sm4-cfb<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>aes-256-cfb1<\/td>\n<td>aria-256-cfb8<\/td>\n<td>camellia-256-ctr<\/td>\n<td>sm4-ctr<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>aes-256-cfb8<\/td>\n<td>aria-256-ctr<\/td>\n<td>camellia-256-ecb<\/td>\n<td>sm4-ecb<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>aes-256-ctr<\/td>\n<td>aria-256-ecb<\/td>\n<td>camellia-256-ofb<\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>aes-256-ecb<\/td>\n<td>aria-256-gcm<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>aes-256-gcm<\/td>\n<td>aria-256-ofb<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>aes-256-ofb<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>aes-256-xts<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\n    Help &amp; Support<\/h2>\n<p>If you require assistance using this library start by viewing the HELP.md file included in this package. It includes common problems and their solutions.<\/p>\n<p>If you continue to have difficulty using this code please <b>do not contact me through this website<\/b>. Since this software is free to the community, the community can assist me in supporting it. I am an active participant at <a href=\"http:\/\/stackoverflow.com\/questions\/ask?tags=php,encryption,openssl\" rel=\"external\">StackOverflow<\/a>. Others also frequent it who are also capable of assiting you with this code. When posting your question there, or anywhere for that matter, be sure to include the following:<\/p>\n<ul>\n<li>A link to either this tutorial and\/or the GitHub repository so others can see what software you are using and can download it if necessary so if they attempt to reproduce the problem you are having.<\/li>\n<li>Your code as it is implemented in your software. Make sure you format it so it is readable by others. Be sure to include all of the relevant pieces including:\n<ul>\n<li>Your unencrypted text<\/li>\n<li>The key you are using<\/li>\n<li>The IV you are using<\/li>\n<li>The output of your method calls<\/li>\n<\/ul>\n<\/li>\n<li>A description of what you are expecting your code to do (but it is not happening).<\/li>\n<li>Any error message you are getting.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Encryption is a complicated topic and one that, when done incorrectly, could result in sensitive data being exposed to bad actors or lost due to an inability to decrypt that data at a later date. The PHP Simple Encryption library is designed to simplify the process of encrypting and decrypting data while ensuring best practices are followed. By default is uses a secure encryption algorithm and generates a cryptologically strong initialization vector (more on that later) so developers do not need to become experts in encryption to securely store sensitive data. <a href=\"https:\/\/website-0f9bf4a4.hpx.ppi.temporary.site\/blog\/php-simple-encryption\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[16],"tags":[89,50],"class_list":["post-693","post","type-post","status-publish","format-standard","hentry","category-programming","tag-encryption","tag-php"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pwpo4-bb","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/website-0f9bf4a4.hpx.ppi.temporary.site\/blog\/wp-json\/wp\/v2\/posts\/693","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/website-0f9bf4a4.hpx.ppi.temporary.site\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/website-0f9bf4a4.hpx.ppi.temporary.site\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/website-0f9bf4a4.hpx.ppi.temporary.site\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/website-0f9bf4a4.hpx.ppi.temporary.site\/blog\/wp-json\/wp\/v2\/comments?post=693"}],"version-history":[{"count":10,"href":"https:\/\/website-0f9bf4a4.hpx.ppi.temporary.site\/blog\/wp-json\/wp\/v2\/posts\/693\/revisions"}],"predecessor-version":[{"id":757,"href":"https:\/\/website-0f9bf4a4.hpx.ppi.temporary.site\/blog\/wp-json\/wp\/v2\/posts\/693\/revisions\/757"}],"wp:attachment":[{"href":"https:\/\/website-0f9bf4a4.hpx.ppi.temporary.site\/blog\/wp-json\/wp\/v2\/media?parent=693"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/website-0f9bf4a4.hpx.ppi.temporary.site\/blog\/wp-json\/wp\/v2\/categories?post=693"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/website-0f9bf4a4.hpx.ppi.temporary.site\/blog\/wp-json\/wp\/v2\/tags?post=693"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}