完全便携式C89中的SHA-1? [英] SHA-1 in fully-portable C89?

查看:74
本文介绍了完全便携式C89中的SHA-1?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



(SHA-1是一个加密哈希函数。有关SHA-1是什么的信息:
http://en.wikipedia.org/wiki/SHA-1


我'我正在编写需要使用SHA-1

算法的全便携C89代码。有没有人知道SHA-1算法是否有完全可移植的C89

实现?


如果没有,请有人指点我一个非常好的实现

算法,一个非常便携的实现(可能是便携式的,具有8位字节的
机器,具有精确的16位,32 -Bit和64-Bit

整数类型)?


我已经完成了一些谷歌搜索,但我已经收回了很多子搜索-standard

平台专用代码。


谢谢。


-

Tomásóhéilidhe

解决方案

12月31日,7:31 * pm,Tomásóhéilidhe < t ... @ lavabit.comwrote:


(SHA-1是一个加密哈希函数。有关SHA-1是什么的信息: http://en.wikipedia.org/wiki/SHA-1 ) />

我正在编写需要使用SHA-1

算法的全便携C89代码。有没有人知道SHA-1算法是否有完全可移植的C89

实现?


如果没有,请有人指点我一个非常好的实现

算法,一个非常便携的实现(可能是便携式的,具有8位字节的
机器,具有精确的16位,32 -Bit和64-Bit

整数类型)?


我已经完成了一些谷歌搜索,但我已经收回了很多子搜索-standard

特定于平台的代码。



这里:
http://www.mirrors.wiretapped.net/se.../call-6/sha1.c
http:// www.mirrors.wiretapped.net/se.../call-6/sha1.h


谷歌搜索sha1.c点亮了数以万计。


FWIW,最佳实现(通常速度提高2倍-4倍)

将有内联汇编,所以难怪你正在拉起非便宜的东西。


试试这个:
http://ece.gmu.edu/courses/Crypto_re.../libraries.htm

我想通过多练习你会学会如何用谷歌找到东西



另一个不错的选择是SourceForge。


哦,顺便说一句,搜索C源代码不是关于

news:comp.lang.c(但是新闻的FAQ参考:comp .sources.wanted

无可救药地过时了)


12月31日,7:31 * pm,Tomásóhéilidhe < t ... @ lavabit.comwrote:


(SHA-1是一个加密哈希函数。有关SHA-1是什么的信息: http://en.wikipedia.org/wiki/SHA-1 ) />

我正在编写需要使用SHA-1

算法的全便携C89代码。有没有人知道SHA-1算法是否有完全可移植的C89

实现?


如果没有,请有人指点我一个非常好的实现

算法,一个非常便携的实现(可能是便携式的,具有8位字节的
机器,具有精确的16位,32 -Bit和64-Bit

整数类型)?


我已经完成了一些谷歌搜索,但我已经收回了很多子搜索-standard

特定于平台的代码。



还有一个新闻组叫做news:sci.crypt这个

的东西。

不幸的是,它现在被垃圾邮件轰炸了,所以读取它有点难。

有些新闻阅读器可以删除大部分垃圾。 />


在文章< Xn ************************** @ 194.125.133.14> ,Tomásó
$ b $bhéilidhe< to*@lavabit.comwrites


>
(SHA-1是加密哈希功能。有关SHA-1的信息:
http:/ /en.wikipedia.org/wiki/SHA-1

我正在编写需要使用SHA-1
算法的全便携C89代码。有谁知道是否有一个完全可移植的C89
实现SHA-1算法?



您可能需要ISO C95版本。 C89被ISO

C90取代,93-95修正了一些。你会发现更多的编译器支持

c95比其他任何东西都要好。


>如果没有,有人可以指点我一个非常好的实现该算法是一种非常便携的实现(可能可移植到具有8位字节且具有精确的16位,32位和64位整数类型的机器) ?



你不想要太多...我相信有人可以卖给你你需要的东西。


>我已经完成了一些谷歌搜索,但我收回了很多非标准的平台特定代码。



我认为对于很多加密工作,你会发现大多数的b $ b实现都是体系结构或编译器特定的。人们通常需要加密代码才能快速而紧凑。通用代码将不会是




此外,在许多情况下,为了安全起见,作者会希望它不那么容易获得黑客的b $ b。我们使用各种硬件资源来减少显而易见且更安全的事情。隐藏的Whist安全性并不是建议作为主要防御,当它在其他

之上分层时它确实有帮助。

BTW for a repository密码来源见

http: //www.phaedsys.demon.co.uk/chris/index.htm


点击密码。有一个SHA1,SHA2和SHA3实现


为网站状态道歉,但需要进行大修。

-

\ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \

\ / \ / \ / \ / \ Chris Hills Staffs England / \ / \ / \ / \ /

/ \ / \ / ch * **@phaedsys.org www.phaedsys.org \ / \ / \

\ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \\ \\ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ /



(SHA-1 is a cryptographic hash function. For info on what SHA-1 is:
http://en.wikipedia.org/wiki/SHA-1)

I''m writing fullportable C89 code that needs to make use of the SHA-1
algorithm. Does anyone know if there''s been a fully-portable C89
implementation of the SHA-1 algorithm?

If not, could someone please point me to a very good implementation of the
algorithm, an implementation which is very portable (perhaps portable to
machines with 8-Bit bytes and which have exact 16-Bit, 32-Bit and 64-Bit
integer types)?

I''ve done a few Google searches but I''m getting back a lot of sub-standard
platform-specific code.

Thanks.

--
Tomás ó héilidhe

解决方案

On Dec 31, 7:31*pm, "Tomás ó héilidhe" <t...@lavabit.comwrote:

(SHA-1 is a cryptographic hash function. For info on what SHA-1 is:http://en.wikipedia.org/wiki/SHA-1)

I''m writing fullportable C89 code that needs to make use of the SHA-1
algorithm. Does anyone know if there''s been a fully-portable C89
implementation of the SHA-1 algorithm?

If not, could someone please point me to a very good implementation of the
algorithm, an implementation which is very portable (perhaps portable to
machines with 8-Bit bytes and which have exact 16-Bit, 32-Bit and 64-Bit
integer types)?

I''ve done a few Google searches but I''m getting back a lot of sub-standard
platform-specific code.

Here:
http://www.mirrors.wiretapped.net/se.../call-6/sha1.c
http://www.mirrors.wiretapped.net/se.../call-6/sha1.h

A google search for "sha1.c" turns up a zillion hits.

FWIW, the best implementations (typically a factor of 2x-4x faster)
will have inline assembly, so no wonder you are pulling up non-
portable stuff.

Try this as well:
http://ece.gmu.edu/courses/Crypto_re.../libraries.htm

I guess with a little more practice you will learn how to find things
yourself with google.
Another good bet is SourceForge.

Oh, and by the way, searches for C source are not topical on
news:comp.lang.c (but the FAQ reference for news:comp.sources.wanted
is hopelessly outdated)


On Dec 31, 7:31*pm, "Tomás ó héilidhe" <t...@lavabit.comwrote:

(SHA-1 is a cryptographic hash function. For info on what SHA-1 is:http://en.wikipedia.org/wiki/SHA-1)

I''m writing fullportable C89 code that needs to make use of the SHA-1
algorithm. Does anyone know if there''s been a fully-portable C89
implementation of the SHA-1 algorithm?

If not, could someone please point me to a very good implementation of the
algorithm, an implementation which is very portable (perhaps portable to
machines with 8-Bit bytes and which have exact 16-Bit, 32-Bit and 64-Bit
integer types)?

I''ve done a few Google searches but I''m getting back a lot of sub-standard
platform-specific code.

One more thing, there is a newsgroup called news:sci.crypt for this
sort of thing.
Unfortunately, it is spam bombarded right now, so it''s a little hard
to read.
Some newsreaders can remove most of the junk, though.


In article <Xn**************************@194.125.133.14>, Tomás ó
héilidhe <to*@lavabit.comwrites

>
(SHA-1 is a cryptographic hash function. For info on what SHA-1 is:
http://en.wikipedia.org/wiki/SHA-1)

I''m writing fullportable C89 code that needs to make use of the SHA-1
algorithm. Does anyone know if there''s been a fully-portable C89
implementation of the SHA-1 algorithm?

You will probably want an ISO C95 version. C89 was superseded by ISO
C90 and some amendments in 93-95. You will find more compilers support
c95 than anything else.

>If not, could someone please point me to a very good implementation of
the algorithm, an implementation which is very portable (perhaps
portable to machines with 8-Bit bytes and which have exact 16-Bit,
32-Bit and 64-Bit integer types)?

You don''t want much do you... I am sure some one can sell you what you
need.

>I''ve done a few Google searches but I''m getting back a lot of
sub-standard platform-specific code.

I think for a lot of crypto work you are going to find most of the
implementations are architecture or compiler specific. People usually
need the crypto code to be fast and compact. Generic code will be
neither.

Also in many cases for security the writer will want it less accessible
to hackers. We used various hardware resources to make things less
obvious and more secure. Whist security by concealment is not
recommended as a prime defence it does help when layered on top of other
things.
BTW for a repository of cypher sources see

http://www.phaedsys.demon.co.uk/chris/index.htm

And click on ciphers. There is an SHA1, SHA2 and SHA3 implementation

Apologies for the state of the web site but it needs an overhaul.
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/


这篇关于完全便携式C89中的SHA-1?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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