PostgreSQL中的数据加密和教程。 [英] Data Encryption in PostgreSQL, and a Tutorial.

查看:100
本文介绍了PostgreSQL中的数据加密和教程。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人为Postgresql创建类似的东西?加密信用卡号码和其他信息非常方便



它保持安全。


如果没有人有创造了这样的东西,我很快就会编码

的东西,但如果它已经存在,那么就没有必要重新发明轮子,所以说出来!在欧盟等地方,如果数据库受到损害,许多类型的数据必须加密,这是一项法律。


如果不存在,我会在几天内提出我的解决方案。但是在我这样做之前,我想提供一个关于如何创建一个

文件的快速教程,该文件将创建表,视图和其他此类必需品。大多数使用PostgreSQL的人只需输入PostgreSQL中的命令,但

不像我要显示的那样容易携带或备份。 />
你!


1.用文件打开vi。

2.只要你添加斜杠,就可以发表评论

行:

- 这是评论。

3.接下来只需输入你想要的SQL命令!

4.完成后,保存文件。

5.然后执行此操作以创建您在文件中创建的数据库:

psql database_name< ; my_vi_file

6.就是这样!


这是一个非常简单的文件样本:


- - 这是一个示例文件。使用风险由您自己承担。无保修

- 由* nixhm的作者Mike Cox撰写。命令。


首先创建表格(

MYNUMBER INTEGER);


创建VIEW myview AS

从第一个选择*;


- 这是结束。正如您所看到的那样,它非常简单和便携。

- 尝试一下。这是如何:psql your_database< this_file

Has anyone created something like that for Postgresql? It would be
really handy to encrypt credit card numbers and other information so
it stays secure.

If no one has created anything such as this, I am going to code up
something quite soon, but if it already exists, there is no need for
me to reinvent the wheel, so speak up! It is a law in places such as
the EU that many types of data must be encrypted if the database is
compromised.

I will put up my solution in a few days if one does not exist. But
before I do that, I want to give a quick tutorial on how to create a
file that will create tables, views and other such essentials. Most
people who use PostgreSQL just type in the commands in PostgreSQL, but
that is not as easily portable or backed up as what I''m about to show
you!

1. open vi with a file.
2. Comments can be made as long as you add to slashes before the
line:
--this is a comment.
3. Next just type in the SQL commands you want!
4. after you are done, save the file.
5. then just do this to create the database you made in the file:
psql database_name < my_vi_file
6.That is it!

Here is a very simple sample of a file:

--This is a sample file. Use at your own risk. No Warranties
--Written by Mike Cox, author of the *nix "hm" command.

create table first(
MYNUMBER INTEGER);

create VIEW myview AS
select * from first;

--Ok this is the end. As you can see it is very simple and portable.
--Try it out. Here''s how: psql your_database < this_file

推荐答案

Mike Cox写道:
Mike Cox wrote:
有没有人为Postgresql创建类似的东西?加密信用卡号码和其他信息真的很方便,所以它保持安全。

如果没有人创造这样的东西,我会编码
很快就会有一些东西,但如果它已经存在,我就没有必要重新发明轮子了,所以大声说出来!在欧盟这样的地方,如果数据库受到损害,许多类型的数据必须加密,这是一项法律。

我会在几天内提出我的解决方案如果一个不存在。但是在我这样做之前,我想提供一个关于如何创建一个
文件的快速教程,该文件将创建表,视图和其他此类必需品。大多数使用PostgreSQL的人只需输入PostgreSQL中的命令,但是
并不像我要展示的那样容易移植或备份
你!

1.用文件打开vi。
2.只要你在
行之前添加斜杠就可以发表评论:
- 这是评论。
接下来只需输入您想要的SQL命令!
4.完成后,保存文件。
5.然后执行此操作以创建您在文件中创建的数据库: br /> psql database_name< my_vi_file
6.就是这样!

这是一个非常简单的文件样本:

- 这是一个示例文件。使用风险由您自己承担。无担保
- 作者:* nixhm的作者Mike Cox撰写命令。

首先创建表格(
MYNUMBER INTEGER);

创建VIEW myview AS
从第一个选择*;

> - 这就结束了。如您所见,它非常简单和便携。
- 试一试。这是如何:psql your_database< this_file
Has anyone created something like that for Postgresql? It would be
really handy to encrypt credit card numbers and other information so
it stays secure.

If no one has created anything such as this, I am going to code up
something quite soon, but if it already exists, there is no need for
me to reinvent the wheel, so speak up! It is a law in places such as
the EU that many types of data must be encrypted if the database is
compromised.

I will put up my solution in a few days if one does not exist. But
before I do that, I want to give a quick tutorial on how to create a
file that will create tables, views and other such essentials. Most
people who use PostgreSQL just type in the commands in PostgreSQL, but
that is not as easily portable or backed up as what I''m about to show
you!

1. open vi with a file.
2. Comments can be made as long as you add to slashes before the
line:
--this is a comment.
3. Next just type in the SQL commands you want!
4. after you are done, save the file.
5. then just do this to create the database you made in the file:
psql database_name < my_vi_file
6.That is it!

Here is a very simple sample of a file:

--This is a sample file. Use at your own risk. No Warranties
--Written by Mike Cox, author of the *nix "hm" command.

create table first(
MYNUMBER INTEGER);

create VIEW myview AS
select * from first;

--Ok this is the end. As you can see it is very simple and portable.
--Try it out. Here''s how: psql your_database < this_file




MySQL内置加密和解密功能,不是Postgresql吗?


Todd



MySQL has encryption and decryption functions built in, doesn''t Postgresql?

Todd


你好,


实际上我会使用带有\e选项的psql。这将允许你按照你的建议做什么
但是你也可以在调试你的语句时让你保持在psql中。然后当

你已经完成并且

你已经使用了适当数量的COMMENT ON语句时,你可以

只需要做一个pg_dump -s

你很高兴。


此致,


Joshua D. Drake

Mike Cox写道:
Hello,

Actually I would use psql with the \e option. This would allow you to do
what you suggest but also
allow you to stay within psql while you debug your statements. Then when
you are all done and
you have used the appropriate amount of COMMENT ON statements, you can
just do a pg_dump -s
and you are good to go.

Sincerely,

Joshua D. Drake
Mike Cox wrote:
有没有人为Postgresql创建类似的东西?加密信用卡号码和其他信息真的很方便,所以它保持安全。

如果没有人创造这样的东西,我会编码
很快就会有一些东西,但如果它已经存在,我就没有必要重新发明轮子了,所以大声说出来!在欧盟这样的地方,如果数据库受到损害,许多类型的数据必须加密,这是一项法律。

我会在几天内提出我的解决方案如果一个不存在。但是在我这样做之前,我想提供一个关于如何创建一个
文件的快速教程,该文件将创建表,视图和其他此类必需品。大多数使用PostgreSQL的人只需输入PostgreSQL中的命令,但是
并不像我要展示的那样容易移植或备份
你!

1。用文件打开vi。
2。只要您在
行之前添加斜杠就可以进行评论:
- 这是评论。
3。接下来只需输入您想要的SQL命令即可!
4。完成后,保存文件。
5。然后只需执行此操作即可创建您在文件中创建的数据库:
psql database_name< my_vi_file
6.就是这样!

这是一个非常简单的文件样本:

- 这是一个示例文件。使用风险由您自己承担。无担保
- 作者:* nixhm的作者Mike Cox撰写命令。

首先创建表格(
MYNUMBER INTEGER);

创建VIEW myview AS
从第一个选择*;

> - 好的,这就是结束。如您所见,它非常简单和便携。
- 试一试。这是如何:psql your_database< this_file

---------------------------(广播结束)--------- ------------------
提示6:您是否搜索了我们的列表档案?

http://archives.postgresql.org
Has anyone created something like that for Postgresql? It would be
really handy to encrypt credit card numbers and other information so
it stays secure.

If no one has created anything such as this, I am going to code up
something quite soon, but if it already exists, there is no need for
me to reinvent the wheel, so speak up! It is a law in places such as
the EU that many types of data must be encrypted if the database is
compromised.

I will put up my solution in a few days if one does not exist. But
before I do that, I want to give a quick tutorial on how to create a
file that will create tables, views and other such essentials. Most
people who use PostgreSQL just type in the commands in PostgreSQL, but
that is not as easily portable or backed up as what I''m about to show
you!

1. open vi with a file.
2. Comments can be made as long as you add to slashes before the
line:
--this is a comment.
3. Next just type in the SQL commands you want!
4. after you are done, save the file.
5. then just do this to create the database you made in the file:
psql database_name < my_vi_file
6.That is it!

Here is a very simple sample of a file:

--This is a sample file. Use at your own risk. No Warranties
--Written by Mike Cox, author of the *nix "hm" command.

create table first(
MYNUMBER INTEGER);

create VIEW myview AS
select * from first;

--Ok this is the end. As you can see it is very simple and portable.
--Try it out. Here''s how: psql your_database < this_file

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org



-

Command Prompt,Inc。,Mammoth PostgreSQL的主页 - S / ODBC和S / JDBC

Postgresql支持,编程共享主机和专用主机。

+ 1-503-667-4564 - jd@commandprompt.com - http://www.commandprompt.com

PostgreSQL Replicator - PostgreSQL的生产质量复制

---- -----------------------(播出结束)---------------------- -----

提示7:别忘了增加免费空间地图设置


--
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-667-4564 - jd@commandprompt.com - http://www.commandprompt.com
PostgreSQL Replicator -- production quality replication for PostgreSQL
---------------------------(end of broadcast)---------------------------
TIP 7: don''t forget to increase your free space map settings


尝试将当局赶出他的踪迹,T。 Relyea" <无**** @ nospam.com>发送:
In an attempt to throw the authorities off his trail, "T. Relyea" <no****@nospam.com> transmitted:
MySQL内置加密和解密功能,不是Postgresql?
MySQL has encryption and decryption functions built in, doesn''t Postgresql?




当然。


参见pgcrypto源代码树中的contrib模块。


由于库依赖性,它通常不会被编译成与典型的Linux / BSD分布分布的内容。它强制进入的是
,以及因加密软件分发的合法性因国家/地区而异,

使其可能在法律上不安全无处不在地包含它。

-

let name =" cbbrowne"和tld =" acm.org"在名称^@中^ tld ;;
http://www.ntlug.org /~cbbrowne/spreadsheets.html

如果上帝意味着我们要成为素食主义者,为什么他要用肉做奶牛?

- - 在保险杠贴纸上看到



But of course.

See the "pgcrypto" contrib module in the source tree.

It is not typically compiled into what gets distributed with the
typical Linux/BSD distribution because of the library dependencies
that it forces in, as well as because the legalities surrounding the
distribution of cryptographic software vary from country to country,
making it potentially legally unsafe to ubiquitously include it.
--
let name="cbbrowne" and tld="acm.org" in name ^ "@" ^ tld;;
http://www.ntlug.org/~cbbrowne/spreadsheets.html
"If God meant us to be vegetarians why''d He make cows out of meat?"
-- seen on a bumper sticker


这篇关于PostgreSQL中的数据加密和教程。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆