Posts

Showing posts from June, 2023

AES ECB vs CBC

Which encryption to use ? ECB is faster. ECB, Electronic Code Book, encrypts two identical blocks into two identical cipher texts. Because of this, it is considered insecure. CBC is slower. CBC, Cipher Block Chaining, involves XORing the plaintext of each block with the previous block’s ciphertext before encrypting. This ensures that if two blocks of plaintext are identical they will produce totally unrelated ciphertext blocks. The “slower” is due to the time required to perform the XOR operation. Using ecb: Key used: 14SZXSWWcB1MXZD09Y1tMOri2kYRsUAHBpjXULetJ8s= Plain text 1: sahkfaskjdaasfhkasfasdf Cipher text: y3Pjdo1Ffkc0Db4IRBRKOPQIerrifGgAiZA8uUS8yLc= Now changing plain text 1 on second position (a changes to c)  Plain text 2: schkfaskjdaasfhkasfasdf Cipher test generated: 4uAHU8xLRn/iX+udKBLxjPQIerrifGgAiZA8uUS8yLc= Here ecb generates identical cipher (only first characters have changed) Encryption with mysql: SET SESSION block_encryption_mode = 'aes-256-ecb'; select TO_B...

Brief Look Into Mysql Enterprise Audit

Image
When installed, the audit plugin enables MySQL Server to produce a log file containing an audit record of server activity. The log contents include when clients connect and disconnect, and what actions they perform while connected, such as which databases and tables they access. Installation and Uninstallation of Audit To be usable by the server, the plugin library must be located in MYSQL plugin dir(select @@plugin_dir) Cd /usr/share/mysql-8.0/ Mysql -uroot -p < audit_log_filter_linux_install.sql Uninstallation DROP TABLE IF EXISTS mysql . audit_log_user ; DROP TABLE IF EXISTS mysql . audit_log_filter ; UNINSTALL PLUGIN audit_log ; DROP FUNCTION audit_log_filter_set_filter ; DROP FUNCTION audit_log_filter_remove_filter ; DROP FUNCTION audit_log_filter_set_user ; DROP FUNCTION audit_log_filter_remove_user ; DROP FUNCTION audit_log_filter_flush ; DROP FUNCTION audit_log_encryption_password_get ; DROP FUNCTION audit_log_encryption_password_set ; DROP FUNCTION ...