-- Создание функции для шифрования
CREATE OR REPLACE FUNCTION sym_enc(input_data text)
RETURNS text AS $$
BEGIN
RETURN pgp_sym_encrypt(input_data,'\xbdc1d8cbc82a89444dd33425b764fa59');
END;
$$ LANGUAGE plpgsql;
-- Создание функции для расшифровки
CREATE OR REPLACE FUNCTION sym_dec(encrypted_data text)
RETURNS text AS $$
BEGIN
RETURN pgp_sym_decrypt(encrypted_data::BYTEA, '\xbdc1d8cbc82a89444dd33425b764fa59');
END;
$$ LANGUAGE plpgsql;
-- Создание функции для шифрования
CREATE OR REPLACE FUNCTION sym_enc(input_data text)
RETURNS text AS $$
BEGIN
RETURN pgp_sym_encrypt(input_data,'\xbdc1d8cbc82a89444dd33425b764fa59');
END;
$$ LANGUAGE plpgsql;
-- Создание функции для расшифровки
CREATE OR REPLACE FUNCTION sym_dec(encrypted_data text)
RETURNS text AS $$
BEGIN
RETURN pgp_sym_decrypt(encrypted_data::BYTEA, '\xbdc1d8cbc82a89444dd33425b764fa59');
END;
$$ LANGUAGE plpgsql;
[Fri Feb 01 15:40:46.703194 2019] [:error] [pid 16899] [remote 192.168.1.6:0] mod_wsgi (pid=16899): Target WSGI script '/var/www/html/django/djangoblog/djangoblog/wsgi.py' cannot be loaded as Python module.
[Fri Feb 01 15:40:46.703252 2019] [:error] [pid 16899] [remote 192.168.1.6:0] mod_wsgi (pid=16899): Exception occurred processing WSGI script '/var/www/html/django/djangoblog/djangoblog/wsgi.py'.
[Fri Feb 01 15:40:46.703275 2019] [:error] [pid 16899] [remote 192.168.1.6:0] Traceback (most recent call last):
[Fri Feb 01 15:40:46.703297 2019] [:error] [pid 16899] [remote 192.168.1.6:0] File "/var/www/html/django/djangoblog/djangoblog/wsgi.py", line 12, in
[Fri Feb 01 15:40:46.703367 2019] [:error] [pid 16899] [remote 192.168.1.6:0] from django.core.wsgi import get_wsgi_application
[Fri Feb 01 15:40:46.703393 2019] [:error] [pid 16899] [remote 192.168.1.6:0] ImportError: No module named django.core.wsgi
WSGIDaemonProcess djangoblogpython-path=/var/www/html/django/djangoblog/ \
python-home=/var/www/html/virtualenv
[Fri Feb 01 15:40:46.703194 2019] [:error] [pid 16899] [remote 192.168.1.6:0] mod_wsgi (pid=16899): Target WSGI script '/var/www/html/django/djangoblog/djangoblog/wsgi.py' cannot be loaded as Python module.
[Fri Feb 01 15:40:46.703252 2019] [:error] [pid 16899] [remote 192.168.1.6:0] mod_wsgi (pid=16899): Exception occurred processing WSGI script '/var/www/html/django/djangoblog/djangoblog/wsgi.py'.
[Fri Feb 01 15:40:46.703275 2019] [:error] [pid 16899] [remote 192.168.1.6:0] Traceback (most recent call last):
[Fri Feb 01 15:40:46.703297 2019] [:error] [pid 16899] [remote 192.168.1.6:0] File "/var/www/html/django/djangoblog/djangoblog/wsgi.py", line 12, in
[Fri Feb 01 15:40:46.703367 2019] [:error] [pid 16899] [remote 192.168.1.6:0] from django.core.wsgi import get_wsgi_application
[Fri Feb 01 15:40:46.703393 2019] [:error] [pid 16899] [remote 192.168.1.6:0] ImportError: No module named django.core.wsgi
$('form').bind('submit', function(e)
Например создал функцию для шифрования:
и для расшифрования:
\xbdc1d8cbc82a89444dd33425b764fa59 - это мой ключ который используется для шифрования и расшифрования. Могу ли я его хранить в базе в процедуре или с точки зрения ИБ должен и ключ зашифровать асиммитрично?