# The Red Matrix: include/crypto.php File Reference

All Classes Namespaces Files Functions Variables Pages
crypto.php File Reference

## Functions

| rsa_sign ($data, $key, $alg= 'sha256')
| rsa_verify ($data, $sig, $key, $alg= 'sha256')
| pkcs5_pad ($text, $blocksize)
| pkcs5_unpad ($text)
| AES256CBC_encrypt ($data, $key, $iv)
| AES256CBC_decrypt ($data, $key, $iv)
| crypto_encapsulate ($data, $pubkey, $alg='aes256cbc')
| aes_encapsulate ($data, $pubkey)
| crypto_unencapsulate ($data, $prvkey)
| aes_unencapsulate ($data, $prvkey)
| new_keypair ($bits)

## Function Documentation

AES256CBC_decrypt | ( |  | $data,
|  |  | $key,
|  |  | $iv
| ) |  |

Referenced by aes_unencapsulate().

AES256CBC_encrypt | ( |  | $data,
|  |  | $key,
|  |  | $iv
| ) |  |

Referenced by aes_encapsulate().

aes_encapsulate | ( |  | $data,
|  |  | $pubkey
| ) |  |

Referenced by crypto_encapsulate(), item_post(), post_activity_item(), and zfinger_init().

aes_unencapsulate | ( |  | $data,
|  |  | $prvkey
| ) |  |

Referenced by crypto_unencapsulate().

crypto_encapsulate | ( |  | $data,
|  |  | $pubkey,
|  |  | $alg = `'aes256cbc'`
| ) |  |

Referenced by get_item_elements(), get_mail_elements(), item_store(), item_store_update(), post_post(), send_message(), zot_build_packet(), and zot_fetch().

crypto_unencapsulate | ( |  | $data,
|  |  | $prvkey
| ) |  |

Referenced by editpost_content(), editwebpage_content(), encode_item(), encode_mail(), mail_post(), new_contact(), post_post(), private_messages_fetch_conversation(), private_messages_fetch_message(), private_messages_list(), probe_content(), tag_deliver(), unobscure(), zot_import(), and zot_refresh().

new_keypair | ( |  | $bits | ) |

Referenced by create_account(), create_identity(), and hostxrd_init().

pkcs5_pad | ( |  | $text,
|  |  | $blocksize
| ) |  |

Referenced by AES256CBC_encrypt().

pkcs5_unpad | ( |  | $text | ) |

Referenced by AES256CBC_decrypt().

rsa_sign | ( |  | $data,
|  |  | $key,
|  |  | $alg = `'sha256'`
| ) |  |

Referenced by create_identity(), fix_system_urls(), import_post(), item_post(), item_store(), item_store_update(), magic_init(), post_activity_item(), post_post(), zfinger_init(), zot_build_packet(), and zot_fetch().

rsa_verify | ( |  | $data,
|  |  | $sig,
|  |  | $key,
|  |  | $alg = `'sha256'`
| ) |  |

Referenced by get_item_elements(), import_site(), import_xchan(), post_init(), post_post(), zfinger_init(), and zot_register_hub().